Class COSObjectPool


  • public class COSObjectPool
    extends java.lang.Object
    An instance of this class maps COSBase instances to COSObjectKeys and allows for a bidirectional lookup.
    • Field Detail

      • highestXRefObjectNumber

        private long highestXRefObjectNumber
    • Constructor Detail

      • COSObjectPool

        public COSObjectPool​(long highestXRefObjectNumber)
        Creates a map of COSBase instances to COSObjectKeys, allowing bidirectional lookups. This constructor can be used for pre - initialized structures to start the assignment of new object numbers starting from the hereby given offset.
        Parameters:
        highestXRefObjectNumber - The highest known object number.
    • Method Detail

      • put

        public COSObjectKey put​(COSObjectKey key,
                                COSBase object)
        Update the key and object maps.
        Parameters:
        key - The key, that shall be added.
        object - The object, that shall be added.
        Returns:
        The actual key, the object has been added for.
      • contains

        public boolean contains​(COSBase object)
        Returns true, if the given COSBase is a registered object of this pool.
        Parameters:
        object - The COSBase that shall be checked.
        Returns:
        True, if such a COSBase is registered in this pool.
      • getHighestXRefObjectNumber

        public long getHighestXRefObjectNumber()
        Returns the highest known object number (see: COSObjectKey for further information), that is currently registered in this pool.
        Returns:
        The highest known object number (see: COSObjectKey for further information), that is currently registered in this pool.