Class COSObjectKey

  • All Implemented Interfaces:
    java.lang.Comparable<COSObjectKey>

    public final class COSObjectKey
    extends java.lang.Object
    implements java.lang.Comparable<COSObjectKey>
    Object representing the physical reference to an indirect pdf object.
    • Field Detail

      • GENERATION_MASK

        private static final long GENERATION_MASK
      • numberAndGeneration

        private final long numberAndGeneration
      • streamIndex

        private final int streamIndex
    • Constructor Detail

      • 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 Detail

      • computeInternalHash

        public static long computeInternalHash​(long num,
                                               int gen)
        Calculate the internal hash value for the given object number and generation number.
        Parameters:
        num - the object number
        gen - 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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • 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()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(COSObjectKey other)
        Specified by:
        compareTo in interface java.lang.Comparable<COSObjectKey>