2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.apache.pdfbox.pdmodel.interactive.measurement;
19 import org.apache.pdfbox.cos.COSBase;
20 import org.apache.pdfbox.cos.COSDictionary;
21 import org.apache.pdfbox.cos.COSName;
22 import org.apache.pdfbox.pdmodel.common.COSObjectable;
25 * This class represents a measure dictionary.
27 * @version $Revision: 1.0 $
30 public class PDMeasureDictionary implements COSObjectable
33 * The type of the dictionary.
35 public static final String TYPE = "Measure";
37 private COSDictionary measureDictionary;
42 protected PDMeasureDictionary()
44 this.measureDictionary = new COSDictionary();
45 this.getDictionary().setName(COSName.TYPE, TYPE);
51 * @param dictionary the corresponding dictionary
53 public PDMeasureDictionary(COSDictionary dictionary)
55 this.measureDictionary = dictionary;
61 public COSBase getCOSObject()
63 return this.measureDictionary;
67 * This will return the corresponding dictionary.
69 * @return the measure dictionary
71 public COSDictionary getDictionary()
73 return this.measureDictionary;
77 * This will return the type of the measure dictionary.
78 * It must be "Measure"
82 public String getType()
88 * returns the subtype of the measure dictionary.
89 * @return the subtype of the measure data dictionary
92 public String getSubtype()
94 return this.getDictionary().getNameAsString(COSName.SUBTYPE,
95 PDRectlinearMeasureDictionary.SUBTYPE);
99 * This will set the subtype of the measure dictionary.
100 * @param subtype the subtype of the measure dictionary
102 protected void setSubtype(String subtype)
104 this.getDictionary().setName(COSName.SUBTYPE, subtype);