Class ReferenceString

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class ReferenceString
    extends java.lang.Object
    implements java.lang.Cloneable
    The reference string object that also can contain a custom reference object.
    Author:
    Christopher Mindus
    • Constructor Summary

      Constructors 
      ConstructorDescription
      ReferenceString​(java.lang.String s)
      Creates the String object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      booleanequals​(java.lang.Object o)
      Checks if two reference strings are equal (including their object).
      booleanequalsOnlyReferenceString​(ReferenceString rs)
      Checks if two reference strings are equal (excluding their object).
      java.lang.ObjectgetObject()
      Gets the Reference Object.
      voidsetObject​(java.lang.Object o)
      Sets the Reference Object.
      java.lang.StringtoString()
      Converts to a String.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ReferenceString

        public ReferenceString​(java.lang.String s)
        Creates the String object.
    • Method Detail

      • setObject

        public void setObject​(java.lang.Object o)
        Sets the Reference Object.
      • getObject

        public java.lang.Object getObject()
        Gets the Reference Object.
      • equalsOnlyReferenceString

        public boolean equalsOnlyReferenceString​(ReferenceString rs)
        Checks if two reference strings are equal (excluding their object). This method is used to check comparisons when saving a file.
        Parameters:
        rs - The other reference string to compare with.
        Returns:
        true for equals, false otherwise.
      • equals

        public boolean equals​(java.lang.Object o)
        Checks if two reference strings are equal (including their object). This is required in order for the reference property to fire notification events.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - The object to compare with.
        Returns:
        true for equals, false otherwise.
      • toString

        public java.lang.String toString()
        Converts to a String.
        Overrides:
        toString in class java.lang.Object