Class CacheId

    • Field Detail

      • EMPTY

        public static final CacheId EMPTY
      • primaryKey

        protected Object[] primaryKey
        The primary key values.
      • hash

        protected int hash
        Cached hashcode.
      • hasArray

        protected boolean hasArray
        Indicates whether at least one element of primaryKey is array.
    • Constructor Detail

      • CacheId

        public CacheId()
      • CacheId

        public CacheId​(Object[] primaryKey)
    • Method Detail

      • getPrimaryKey

        public Object[] getPrimaryKey()
      • setPrimaryKey

        public void setPrimaryKey​(Object[] primaryKey)
      • add

        public void add​(Object value)
        Append the value to the end of the primary key values.
      • set

        public void set​(int index,
                        Object value)
        Set the value in the primary key values.
      • computeHash

        protected int computeHash​(Object[] primaryKey)
        Pre-compute the hash to optimize hash calls.
      • hashCode

        public int hashCode()
        Return the precomputed hashcode.
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object object)
        Determine if the receiver is equal to anObject. If anObject is a CacheKey, do further comparison, otherwise, return false.
        Overrides:
        equals in class Object
        See Also:
        CacheKey.equals(CacheKey)
      • equals

        public boolean equals​(CacheId id)
        Determine if the receiver is equal to key. Use an index compare, because it is much faster than enumerations.
      • compareTo

        public int compareTo​(CacheId otherId)
        Determine if the receiver is greater or less than the key.
        Specified by:
        compareTo in interface Comparable<CacheId>
      • hasArray

        public boolean hasArray()