|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Classes of objects that have an internal state should implement this interface as a better alternative to overriding equals(). The equals() method will be able to keep its original function: identifying objects which are the same instance.
Method Summary | |
java.lang.Class |
getPrincipleInterface()
Returns the class's principle interface for state comparisons. |
boolean |
sameStateAs(HasState victim)
If two HasStates have the same internal state, return true. |
Method Detail |
public java.lang.Class getPrincipleInterface()
public boolean sameStateAs(HasState victim)
For objects with subobjects, Generally this method should only return true if the internal objects are equal. Implement a contentsHaveSameState() method to determine if the contents have the same state.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |