Java Doc for PDFObject.java in  » PDF » PDF-Renderer » com » sun » pdfview » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » PDF » PDF Renderer » com.sun.pdfview 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.pdfview.PDFObject

PDFObject
public class PDFObject (Code)
a class encapsulating all the possibilities of content for an object in a PDF file.

A PDF object can be a simple type, like a Boolean, a Number, a String, or the Null value. It can also be a NAME, which looks like a string, but is a special type in PDF files, like "/Name".

A PDF object can also be complex types, including Array; Dictionary; Stream, which is a Dictionary plus an array of bytes; or Indirect, which is a reference to some other PDF object. Indirect references will always be dereferenced by the time any data is returned from one of the methods in this class.
author:
   Mike Wessler



Field Summary
final public static  intARRAY
    
final public static  intBOOLEAN
    
final public static  intDICTIONARY
    
final public static  intINDIRECT
    
final public static  intKEYWORD
    
final public static  intNAME
    
final public static  intNULL
    
final public static  intNUMBER
    
final public static  intSTREAM
    
final public static  intSTRING
    
final public static  PDFObjectnullObj
    

Constructor Summary
public  PDFObject(PDFFile owner, int type, Object value)
     create a new simple PDFObject with a type and a value
Parameters:
  owner - the PDFFile in which this object resides, usedfor dereferencing.
public  PDFObject(Object obj)
     create a new PDFObject that is the closest match to a given Java object.
public  PDFObject(PDFFile owner, PDFXref xref)
    

Method Summary
public  PDFObjectdereference()
     Make sure that this object is dereferenced.
public  booleanequals(Object o)
     Test whether two PDFObject are equal.
public  PDFObject[]getArray()
     get the value as a PDFObject[].
public  PDFObjectgetAt(int idx)
     if this object is an ARRAY, get the PDFObject at some position in the array.
public  booleangetBooleanValue()
     get the value as a boolean.
public  ObjectgetCache()
     get the value in the cache.
public  IteratorgetDictKeys()
     get an Iterator over all the keys in the dictionary.
public  PDFObjectgetDictRef(String key)
     get the value associated with a particular key in the dictionary.
public  HashMapgetDictionary()
     get the dictionary as a HashMap.
public  doublegetDoubleValue()
     get the value as a double.
public  floatgetFloatValue()
     get the value as a float.
public  intgetIntValue()
     get the value as an int.
public  byte[]getStream()
     get the stream from this object.
public  ByteBuffergetStreamBuffer()
     get the stream from this object as a byte buffer.
public  StringgetStringValue()
     get the value as a String.
public  intgetType()
     get the type of this object.
public  booleanisDictType(String match)
     returns true only if this object is a DICTIONARY or a STREAM, and the "Type" entry in the dictionary matches a given value.
public  voidsetCache(Object obj)
     set the cached value.
public  voidsetStream(ByteBuffer data)
     set the stream of this object.
public  StringtoString()
     return a representation of this PDFObject as a String.

Field Detail
ARRAY
final public static int ARRAY(Code)
an array of PDFObjects



BOOLEAN
final public static int BOOLEAN(Code)
a Boolean



DICTIONARY
final public static int DICTIONARY(Code)
a Hashmap that maps String names to PDFObjects



INDIRECT
final public static int INDIRECT(Code)
an indirect reference



KEYWORD
final public static int KEYWORD(Code)
a special PDF bare word, like R, obj, true, false, etc



NAME
final public static int NAME(Code)
a special string, seen in PDF files as /Name



NULL
final public static int NULL(Code)
the NULL object (there is only one)



NUMBER
final public static int NUMBER(Code)
a Number, represented as a double



STREAM
final public static int STREAM(Code)
a Stream: a Hashmap with a byte array



STRING
final public static int STRING(Code)
a String



nullObj
final public static PDFObject nullObj(Code)
the NULL PDFObject




Constructor Detail
PDFObject
public PDFObject(PDFFile owner, int type, Object value)(Code)
create a new simple PDFObject with a type and a value
Parameters:
  owner - the PDFFile in which this object resides, usedfor dereferencing. This may be null.
Parameters:
  type - the type of object
Parameters:
  value - the value. For DICTIONARY, this is a HashMap.for ARRAY it's an ArrayList. For NUMBER, it's a Double.for BOOLEAN, it's Boolean.TRUE or Boolean.FALSE. Foreverything else, it's a String.



PDFObject
public PDFObject(Object obj) throws PDFParseException(Code)
create a new PDFObject that is the closest match to a given Java object. Possibilities include Double, String, PDFObject[], HashMap, Boolean, or PDFParser.Tok, which should be "true" or "false" to turn into a BOOLEAN.
Parameters:
  obj - the sample Java object to convert to a PDFObject.
throws:
  PDFParseException - if the object isn't one of theabove examples, and can't be turned into a PDFObject.



PDFObject
public PDFObject(PDFFile owner, PDFXref xref)(Code)
create a new PDFObject based on a PDFXref
Parameters:
  owner - the PDFFile from which the PDFXref was drawn
Parameters:
  xref - the PDFXref to turn into a PDFObject




Method Detail
dereference
public PDFObject dereference() throws IOException(Code)
Make sure that this object is dereferenced. Use the cache of an indirect object to cache the dereferenced value, if possible.



equals
public boolean equals(Object o)(Code)
Test whether two PDFObject are equal. Objects are equal IFF they are the same reference OR they are both indirect objects with the same id and generation number in their xref



getArray
public PDFObject[] getArray() throws IOException(Code)
get the value as a PDFObject[]. If this object is an ARRAY, will return the array. Otherwise, will return an array of one element with this object as the element.



getAt
public PDFObject getAt(int idx) throws IOException(Code)
if this object is an ARRAY, get the PDFObject at some position in the array. If this is not an ARRAY, returns null.



getBooleanValue
public boolean getBooleanValue() throws IOException(Code)
get the value as a boolean. Will return false if this object is not a BOOLEAN



getCache
public Object getCache() throws IOException(Code)
get the value in the cache. May become null at any time. the cached value, or null if the value has beengarbage collected.



getDictKeys
public Iterator getDictKeys() throws IOException(Code)
get an Iterator over all the keys in the dictionary. If this object is not a DICTIONARY or a STREAM, returns an Iterator over the empty list.



getDictRef
public PDFObject getDictRef(String key) throws IOException(Code)
get the value associated with a particular key in the dictionary. If this isn't a DICTIONARY or a STREAM, or there is no such key, returns null.



getDictionary
public HashMap getDictionary() throws IOException(Code)
get the dictionary as a HashMap. If this isn't a DICTIONARY or a STREAM, returns null



getDoubleValue
public double getDoubleValue() throws IOException(Code)
get the value as a double. Will return 0 if this object isn't a NUMBER.



getFloatValue
public float getFloatValue() throws IOException(Code)
get the value as a float. Will return 0 if this object isn't a NUMBER



getIntValue
public int getIntValue() throws IOException(Code)
get the value as an int. Will return 0 if this object isn't a NUMBER.



getStream
public byte[] getStream() throws IOException(Code)
get the stream from this object. Will return null if this object isn't a STREAM. the stream, or null, if this isn't a STREAM.



getStreamBuffer
public ByteBuffer getStreamBuffer() throws IOException(Code)
get the stream from this object as a byte buffer. Will return null if this object isn't a STREAM. the buffer, or null, if this isn't a STREAM.



getStringValue
public String getStringValue() throws IOException(Code)
get the value as a String. Will return null if the object isn't a STRING, NAME, or KEYWORD. This method will NOT convert a NUMBER to a String.



getType
public int getType() throws IOException(Code)
get the type of this object. The object will be dereferenced, so INDIRECT will never be returned. the type of the object



isDictType
public boolean isDictType(String match) throws IOException(Code)
returns true only if this object is a DICTIONARY or a STREAM, and the "Type" entry in the dictionary matches a given value.
Parameters:
  match - the expected value for the "Type" key in thedictionary whether the dictionary is of the expected type



setCache
public void setCache(Object obj) throws IOException(Code)
set the cached value. The object may be garbage collected if no other reference exists to it.
Parameters:
  obj - the object to be cached



setStream
public void setStream(ByteBuffer data)(Code)
set the stream of this object. It should have been a DICTIONARY before the call.
Parameters:
  data - the data, as a ByteBuffer.



toString
public String toString()(Code)
return a representation of this PDFObject as a String. Does NOT dereference anything: this is the only method that allows you to distinguish an INDIRECT PDFObject.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.