org.gnu6.six
Class State

java.lang.Object
  |
  +--org.gnu6.six.State

public class State
extends java.lang.Object

This class represents the state of the project implemented in GNU6 environment. Basically, it is a modification of the java class - Hashtable. The modification allows shared access to this class from multiple threads.


Constructor Summary
State()
           
 
Method Summary
 void clear()
          Clears this hashtable so that it contains no keys.
 boolean containsKey(java.lang.Object key)
          Tests if the specified object is a key in this hashtable.
 boolean containsValue(java.lang.Object value)
          Returns true if this Hashtable maps one or more keys to this value.
 void doneWithSuccess(boolean scs)
          Reports about the status of a move.
 java.util.Enumeration elements()
          Returns an enumeration of the values in this hashtable.
 java.lang.Object get(java.lang.Object key)
          Returns the value to which the specified key is mapped in this hashtable.
 boolean isEmpty()
          Tests if this hashtable maps no keys to values.
 boolean isItSuccess()
          Notifies about the status of the move execution.
 java.util.Enumeration keys()
          Returns an enumeration of the keys in this hashtable.
 void put(java.lang.Object key, java.lang.Object value)
          Maps the specified key to the specified value in this hashtable.
 java.lang.Object remove(java.lang.Object key)
          Removes the key (and its corresponding value) from this hashtable.
 void SetIsItDone(boolean scs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

State

public State()
Method Detail

put

public void put(java.lang.Object key,
                java.lang.Object value)
         throws java.lang.NullPointerException,
                java.lang.IllegalMonitorStateException
Maps the specified key to the specified value in this hashtable.

Parameters:
key - - the hashtable key.
value - - the value.
Returns:
the previous value of the specified key in this hashtable, or null if it did not have one.
Throws:
java.lang.NullPointerException - - if the key or value is null.
java.lang.IllegalMonitorStateException - - if the current thread is not the owner of this object's monitor.

get

public java.lang.Object get(java.lang.Object key)
                     throws java.lang.IllegalMonitorStateException
Returns the value to which the specified key is mapped in this hashtable.

Parameters:
key - - a key in the hashtable.
Returns:
the value to which the key is mapped in this hashtable; null if the key is not mapped to any value in this hashtable.
Throws:
java.lang.IllegalMonitorStateException - - if the current thread is not the owner of this object's monitor.

containsKey

public boolean containsKey(java.lang.Object key)
                    throws java.lang.IllegalMonitorStateException
Tests if the specified object is a key in this hashtable.

Parameters:
key - - possible key.
Returns:
true if and only if the specified object is a key in this hashtable, as determined by the equals method; false otherwise.
Throws:
java.lang.IllegalMonitorStateException - - if the current thread is not the owner of this object's monitor.

containsValue

public boolean containsValue(java.lang.Object value)
                      throws java.lang.IllegalMonitorStateException
Returns true if this Hashtable maps one or more keys to this value. Note that this method is identical in functionality to contains (which predates the Map interface).

Parameters:
value - - value whose presence in this Hashtable is to be tested.
Returns:
true if this map maps one or more keys to the specified value.
Throws:
java.lang.IllegalMonitorStateException - - if the current thread is not the owner of this object's monitor.

elements

public java.util.Enumeration elements()
                               throws java.lang.IllegalMonitorStateException
Returns an enumeration of the values in this hashtable.

Returns:
an enumeration of the values in this hashtable.
java.lang.IllegalMonitorStateException

isEmpty

public boolean isEmpty()
                throws java.lang.IllegalMonitorStateException
Tests if this hashtable maps no keys to values.

Returns:
true if this hashtable maps no keys to values; false otherwise.
Throws:
java.lang.IllegalMonitorStateException - - if the current thread is not the owner of this object's monitor.

keys

public java.util.Enumeration keys()
Returns an enumeration of the keys in this hashtable.

Returns:
an enumeration of the keys in this hashtable.
Throws:
java.lang.IllegalMonitorStateException - - if the current thread is not the owner of this object's monitor.

clear

public void clear()
           throws java.lang.UnsupportedOperationException,
                  java.lang.IllegalMonitorStateException
Clears this hashtable so that it contains no keys.

Throws:
java.lang.UnsupportedOperationException - - clear is not supported by this map.
java.lang.IllegalMonitorStateException - - if the current thread is not the owner of this object's monitor.

remove

public java.lang.Object remove(java.lang.Object key)
                        throws java.lang.IllegalMonitorStateException
Removes the key (and its corresponding value) from this hashtable.

Parameters:
key - - the key that needs to be removed.
Returns:
the value to which the key had been mapped in this hashtable, or null if the key did not have a mapping.
Throws:
java.lang.IllegalMonitorStateException - - if the current thread is not the owner of this object's monitor.

isItSuccess

public boolean isItSuccess()
                    throws java.lang.IllegalMonitorStateException,
                           java.lang.InterruptedException
Notifies about the status of the move execution. A move can fail or be successful.

Returns:
true if the execution of move was perform with success. Otherwise, false.
Throws:
java.lang.IllegalMonitorStateException - - if the current thread is not the owner of this object's monitor.
java.lang.InterruptedException - if another thread has interrupted the current thread. The interrupted status of the current thread is cleared when this exception is thrown.

doneWithSuccess

public void doneWithSuccess(boolean scs)
                     throws java.lang.IllegalMonitorStateException
Reports about the status of a move. Any move after completing its execution must report about its status.

Throws:
java.lang.IllegalMonitorStateException - - if the current thread is not the owner of this object's monitor.

SetIsItDone

public void SetIsItDone(boolean scs)
                 throws java.lang.IllegalMonitorStateException
java.lang.IllegalMonitorStateException