Class ReferenceString
java.lang.Object
com.iizix.prop.ReferenceString
- All Implemented Interfaces:
Cloneable
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionclone()Clones the reference string.booleanChecks if two reference strings are equal (including their object).booleanChecks if two reference strings are equal (excluding their object).Gets the Reference Object.inthashCode()Returns the hash code, consistent withequals(Object).voidSets the Reference Object.toString()Converts to a String.
Constructor Details
ReferenceString
Creates the String object.
Method Details
setObject
Sets the Reference Object.- Parameters:
o- Any object ornullfor none.
getObject
clone
Clones the reference string.- Overrides:
clonein classObject- Returns:
- A cloned ReferenceString instance, with the SAME object reference as set by
setObject(Object).
equalsOnlyReferenceString
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
hashCode
public int hashCode()Returns the hash code, consistent withequals(Object).Only the reference string takes part. Two instances that are equal always carry the same string, so the contract holds, and the mutable object set by
setObject(Object)is deliberately left out so that the hash code of an instance already held in a hashed collection cannot change under it.toString