com.croftsoft.core.util.state
Class StateLib

java.lang.Object
  extended by com.croftsoft.core.util.state.StateLib

public class StateLib
extends Object

Static methods to support concrete implementations of the State interface.

Reference:
Mark Roulo, "How to avoid traps and correctly override methods from java.lang.Object", January 1999, JavaWorld.

Version:
1999-02-06
Author:
David Wallace Croft

Method Summary
static boolean equals(State state, Object other)
          Returns true if the classes and State keys are equal.
static int hashCode(State state)
          Returns the hash code of the State key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public static boolean equals(State state,
                             Object other)
Returns true if the classes and State keys are equal. State implementation usage:
 public boolean  equals ( Object  other )
 {
   return StateLib.equals ( this, other );
 }
 


hashCode

public static int hashCode(State state)
Returns the hash code of the State key.
   return state.getKey ( ).hashCode ( );
 
State implementation usage:
 public int  hashCode ( )
 {
   return StateLib.hashCode ( this );
 }
 


CroftSoft Javadoc

CroftSoft Core Javadoc (2008-09-28 20:58:02)