Class ReferenceString

java.lang.Object
com.iizix.prop.ReferenceString
All Implemented Interfaces:
Cloneable

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

    • ReferenceString

      public ReferenceString(String s)
      Creates the String object.
  • Method Details

    • setObject

      public void setObject(Object o)
      Sets the Reference Object.
      Parameters:
      o - Any object or null for none.
    • getObject

      public Object getObject()
      Gets the Reference Object.
      Returns:
      The object set by setObject(Object).
    • clone

      public ReferenceString clone()
      Clones the reference string.
      Overrides:
      clone in class Object
      Returns:
      A cloned ReferenceString instance, with the SAME object reference as set by setObject(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(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 Object
      Parameters:
      o - The object to compare with.
      Returns:
      true for equals, false otherwise.
    • toString

      public String toString()
      Converts to a String.
      Overrides:
      toString in class Object
      Returns:
      The string reference.