001         package com.croftsoft.core.util.state;
002    
003         /*********************************************************************
004         * The state of an object may be communicated by a State object.
005         * Each State object has a unique key, usually the object or its unique
006         * identifier whose state or a portion of its state is reflected by
007         * this State object.
008         *
009         * <P>
010         *
011         * State objects are considered equal if their classes and keys are
012         * equal.  This makes a State object useful in Set collections where
013         * the state or the latest subset of the state of the key object should
014         * should only be contained once.  One application is the queued
015         * transmission of object state information wherein only the latest
016         * state data should be retained.
017         *
018         * @see
019         *   StateLib
020         * @author
021         *   <a href="https://www.croftsoft.com/">David Wallace Croft</a>
022         * @version
023         *   1999-02-06
024         *********************************************************************/
025    
026         public interface State
027         //////////////////////////////////////////////////////////////////////
028         //////////////////////////////////////////////////////////////////////
029         {
030    
031         /*********************************************************************
032         * Returns the State key, usually the object or its unique identifier
033         * whose state or a portion of its state is reflected by this State
034         * object.
035         *********************************************************************/
036         public Object  getKey ( );
037    
038         /*********************************************************************
039         * Returns true if the classes and State keys are equal.
040         *********************************************************************/
041         public boolean  equals ( Object  other );
042    
043         /*********************************************************************
044         * Returns the hash code of the State key.
045         *********************************************************************/
046         public int  hashCode ( );
047    
048         //////////////////////////////////////////////////////////////////////
049         //////////////////////////////////////////////////////////////////////
050         }