01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /* $Id$ */
19:
20: package org.apache.xmlgraphics.ps;
21:
22: /**
23: * PSResource subclass that represents a ProcSet resource.
24: */
25: public class PSProcSet extends PSResource {
26:
27: private float version;
28: private int revision;
29:
30: /**
31: * Creates a new instance.
32: * @param name name of the resource
33: */
34: public PSProcSet(String name) {
35: this (name, 1.0f, 0);
36: }
37:
38: /**
39: * Creates a new instance.
40: * @param name name of the resource
41: * @param version version of the resource
42: * @param revision revision of the resource
43: */
44: public PSProcSet(String name, float version, int revision) {
45: super (TYPE_PROCSET, name);
46: this .version = version;
47: this .revision = revision;
48: }
49:
50: /** @return the version */
51: public float getVersion() {
52: return version;
53: }
54:
55: /** @return the revision */
56: public int getRevision() {
57: return revision;
58: }
59:
60: /** @return the <resource> specification as defined in DSC v3.0 spec. */
61: public String getResourceSpecification() {
62: StringBuffer sb = new StringBuffer();
63: sb.append(getType()).append(" ").append(
64: PSGenerator.convertStringToDSC(getName()));
65: sb.append(" ").append(
66: PSGenerator.convertRealToDSC(getVersion()));
67: sb.append(" ").append(Integer.toString(getRevision()));
68: return sb.toString();
69: }
70:
71: }
|