01: /*
02: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
03: *
04: * This file is part of Resin(R) Open Source
05: *
06: * Each copy or derived work must preserve the copyright notice and this
07: * notice unmodified.
08: *
09: * Resin Open Source is free software; you can redistribute it and/or modify
10: * it under the terms of the GNU General Public License as published by
11: * the Free Software Foundation; either version 2 of the License, or
12: * (at your option) any later version.
13: *
14: * Resin Open Source is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17: * of NON-INFRINGEMENT. See the GNU General Public License for more
18: * details.
19: *
20: * You should have received a copy of the GNU General Public License
21: * along with Resin Open Source; if not, write to the
22: *
23: * Free Software Foundation, Inc.
24: * 59 Temple Place, Suite 330
25: * Boston, MA 02111-1307 USA
26: *
27: * @author Scott Ferguson
28: */
29:
30: package com.caucho.quercus.lib.pdf;
31:
32: /**
33: * pdf object oriented API facade
34: */
35: public class PDFProcSet {
36:
37: private int _id;
38: private String _set = "";
39:
40: PDFProcSet() {
41: }
42:
43: void setId(int id) {
44: _id = id;
45: }
46:
47: public int getId() {
48: return _id;
49: }
50:
51: public void add(String proc) {
52: if (_set.indexOf(proc) >= 0)
53: return;
54:
55: if (_set.length() > 0)
56: _set = _set + ' ' + proc;
57: else
58: _set = proc;
59: }
60:
61: String getResource() {
62: return ("/ProcSet [" + _set + "]");
63: }
64:
65: public int hashCode() {
66: return _set.hashCode();
67: }
68:
69: public boolean equals(Object o) {
70: if (this == o)
71: return true;
72: else if (!(o instanceof PDFProcSet))
73: return false;
74:
75: PDFProcSet set = (PDFProcSet) o;
76:
77: return _set.equals(set._set);
78: }
79:
80: public String toString() {
81: return "PDFProcSet[" + _set + "]";
82: }
83: }
|