PDFCosNumeric.java
2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.cos.CosNumeric
* com.adobe.internal.pdftoolkit.core.cos.CosObject
* com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException
*/
package com.adobe.internal.pdftoolkit.pdf.document;
import com.adobe.internal.pdftoolkit.core.cos.CosNumeric;
import com.adobe.internal.pdftoolkit.core.cos.CosObject;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosObject;
public class PDFCosNumeric
extends PDFCosObject {
private PDFCosNumeric(CosObject cosObject) throws PDFInvalidDocumentException {
super(cosObject);
if (!(cosObject instanceof CosNumeric)) {
throw new PDFInvalidDocumentException("CosNumeric expected");
}
}
public static PDFCosNumeric getInstance(CosObject cosObject) throws PDFInvalidDocumentException {
if (PDFCosObject.checkNullCosObject(cosObject) == null) {
return null;
}
PDFCosNumeric pdfObject = PDFCosObject.getCachedInstance(cosObject, PDFCosNumeric.class);
if (pdfObject == null) {
pdfObject = new PDFCosNumeric(cosObject);
}
return pdfObject;
}
public int intValue() {
if (!(this.getCosObject() instanceof CosNumeric)) {
return 0;
}
return ((CosNumeric)this.getCosObject()).intValue();
}
public int fixedValue() throws PDFCosParseException {
if (!(this.getCosObject() instanceof CosNumeric)) {
return 0;
}
return ((CosNumeric)this.getCosObject()).fixedValue();
}
public long longValue() {
if (!(this.getCosObject() instanceof CosNumeric)) {
return 0;
}
return ((CosNumeric)this.getCosObject()).longValue();
}
public double doubleValue() {
if (!(this.getCosObject() instanceof CosNumeric)) {
return 0.0;
}
return ((CosNumeric)this.getCosObject()).doubleValue();
}
public Number numberValue() {
if (!(this.getCosObject() instanceof CosNumeric)) {
return null;
}
return ((CosNumeric)this.getCosObject()).numberValue();
}
public Object getValue() {
if (!(this.getCosObject() instanceof CosNumeric)) {
return null;
}
return ((CosNumeric)this.getCosObject()).getValue();
}
}