Class CompositeKey


  • public final class CompositeKey
    extends java.lang.Object
    A class that can be used to combine multiple objects as one key. Useful for example in maps.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int m_hashCode  
      private java.lang.Object[] m_keys  
    • Constructor Summary

      Constructors 
      Constructor Description
      CompositeKey​(java.lang.Object[] keys)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object that)  
      java.lang.Object[] getKeyElements()  
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_hashCode

        private final int m_hashCode
      • m_keys

        private final java.lang.Object[] m_keys
    • Constructor Detail

      • CompositeKey

        public CompositeKey​(java.lang.Object[] keys)
        Parameters:
        keys - array of key objects
    • Method Detail

      • getKeyElements

        public java.lang.Object[] getKeyElements()
        Returns:
        the array of key objects
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object that)
        Overrides:
        equals in class java.lang.Object