Interface Identifiable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Returns a copy of this object identified by a copy of the orignial's id.
      int compareTo​(java.lang.Object o)
      Imposes a natural ordering on Identifiable objects.
      boolean equals​(java.lang.Object o)
      Indicates that this object is to be regarded as equal to some other object.
      ID getID()
      Returns the id uniquely identifying this object.
      int hashCode()
      As we want to use the hashCode/equals contract we need to force the implementation of hashCode.
    • Method Detail

      • getID

        ID getID()
        Returns the id uniquely identifying this object.
        Specified by:
        getID in interface Unique
      • clone

        java.lang.Object clone()
                        throws java.lang.CloneNotSupportedException
        Returns a copy of this object identified by a copy of the orignial's id. I.e., the following statement holds true: this.getID() != this.clone().getID()
        Throws:
        java.lang.CloneNotSupportedException - DOCUMENT-ME
      • equals

        boolean equals​(java.lang.Object o)
        Indicates that this object is to be regarded as equal to some other object. Especially with implementing sub classes of Identifiable, equality will often be established through the equality of ids.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        int hashCode()
        As we want to use the hashCode/equals contract we need to force the implementation of hashCode.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hashCode of the current object
      • compareTo

        int compareTo​(java.lang.Object o)
        Imposes a natural ordering on Identifiable objects. Especially with implementing sub classes of Identifiable, such orderings will often be established by the natural order of ids.
        Specified by:
        compareTo in interface java.lang.Comparable<java.lang.Object>