Package org.apache.pdfbox.cos
Class COSObjectKey
java.lang.Object
org.apache.pdfbox.cos.COSObjectKey
- All Implemented Interfaces:
Comparable<COSObjectKey>
Object representing the physical reference to an indirect pdf object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate static final intprivate final longprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionCOSObjectKey(long num, int gen) Constructor.COSObjectKey(long num, int gen, int index) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(COSObjectKey other) static final longcomputeInternalHash(long num, int gen) Calculate the internal hash value for the given object number and generation number.booleanintThis will get the object generation number.longReturn the internal hash value which is based on the number and the generation.longThis will get the object number.intThe index within a compressed object stream.inthashCode()toString()
-
Field Details
-
NUMBER_OFFSET
private static final int NUMBER_OFFSET- See Also:
-
GENERATION_MASK
private static final long GENERATION_MASK -
numberAndGeneration
private final long numberAndGeneration -
streamIndex
private final int streamIndex
-
-
Constructor Details
-
COSObjectKey
public COSObjectKey(long num, int gen) Constructor.- Parameters:
num- The object number.gen- The object generation number.
-
COSObjectKey
public COSObjectKey(long num, int gen, int index) Constructor.- Parameters:
num- The object number.gen- The object generation number.index- The index within a compressed object stream
-
-
Method Details
-
computeInternalHash
public static final long computeInternalHash(long num, int gen) Calculate the internal hash value for the given object number and generation number.- Parameters:
num- the object numbergen- the generation number- Returns:
- the internal hash for the given values
-
getInternalHash
public long getInternalHash()Return the internal hash value which is based on the number and the generation.- Returns:
- the internal hash value
-
equals
-
getGeneration
public int getGeneration()This will get the object generation number.- Returns:
- The object generation number.
-
getNumber
public long getNumber()This will get the object number.- Returns:
- The object number.
-
getStreamIndex
public int getStreamIndex()The index within a compressed object stream.- Returns:
- the index within a compressed object stream if applicable otherwise -1
-
hashCode
public int hashCode() -
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<COSObjectKey>
-