org.hops.dm.tad
Class queuepair

java.lang.Object
  extended by org.hops.dm.tad.queuepair
All Implemented Interfaces:
java.io.Serializable

public class queuepair
extends java.lang.Object
implements java.io.Serializable

queue of nimPair

Version:
3.0
Author:
Meritxell Gonzalez
See Also:
Serialized Form

Constructor Summary
queuepair()
          Creates a new instance of stackpair
queuepair(queueact queuesrc, turn DP)
          Creates a new instance of stackpair and copy the input queueact and sets the DP
 
Method Summary
 void add(queueact queuesrc, turn DP)
          push all the elements of the queue in the same order of this queue
 void cancel_shift()
          abort shift count
 void clear()
          remove all the elements of the queue
 java.lang.Object clone()
          Creates and returns a copy of this object.
 boolean contains(action act)
          Tests if the queue contains an element with the specified action, independently of the turn
 boolean contains(actionset actid)
          Tests if an object with the specified actionset is a component of this queue
 boolean contains(actionset actid, condition attr)
          Test if the queue contains ALL the element with the specified actionset and attribute name of the condition
 boolean contains(actionset actid, java.lang.String attr)
          Test if the queue contains an element with the specified actionset and attribute name
 boolean contains(actionset actid, turn DP)
          Test if the queue contains an element with the specified actionset and turn
 boolean contains(attrval_ext ext)
          Test if the queue contains an element with the specified attribute extension
 boolean contains(nimPair _w)
          Tests if the specified object is a component in this queue.
 boolean containsAll(queueact queuesrc)
          Tests if the current queue contains at least all the elements of the specified queue
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this one.
 boolean equalsTo(queuepair _w)
          Indicates whether a queuepair contains at least the same elements thab this one.
 nimPair first()
          Looks at the object at the head of this stack without removing it from the queue.
 boolean fully_shifted()
          all the elements of the queue has been head
 action get(actionset actid)
          Returns the first element found with the specified actionset
 action get(actionset actid, turn DP)
          Returns the first element found with the specified actionset and turn
 nimPair get(int i)
          Returns the element at the specified position in this queue.
 queueact getAll(actionset actid)
          Returns all the actions in a queue that are of the specified actionset
 int hashCode()
           
 void ini_shift()
          initialized the shift count
 boolean is_empty()
          Tests if there are any element in the queue
 nimPair pop()
          Removes the object at the head of this queue and returns that object as the value of this function, or an empty value if the queue is empty.
 void push(nimPair _w)
          Pushes an item onto the head of this queue.
 void remove(action act)
          Remove the element from the queue that is equals to the specified action, independently of the turn
 void remove(nimPair _w)
          remove the element from the queue
 int search(nimPair nim)
          Searches the index for the specified object.
 void shift()
          push the first element in the queue at the end
 int size()
          Returns the number of components in this queue.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

queuepair

public queuepair()
Creates a new instance of stackpair


queuepair

public queuepair(queueact queuesrc,
                 turn DP)
Creates a new instance of stackpair and copy the input queueact and sets the DP

Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object

equalsTo

public boolean equalsTo(queuepair _w)
Indicates whether a queuepair contains at least the same elements thab this one.


is_empty

public boolean is_empty()
Tests if there are any element in the queue


clone

public java.lang.Object clone()
Creates and returns a copy of this object.

Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object

add

public void add(queueact queuesrc,
                turn DP)
push all the elements of the queue in the same order of this queue


first

public nimPair first()
Looks at the object at the head of this stack without removing it from the queue.


push

public void push(nimPair _w)
Pushes an item onto the head of this queue. If the item exists in the queue, remove from its old position


pop

public nimPair pop()
Removes the object at the head of this queue and returns that object as the value of this function, or an empty value if the queue is empty.


clear

public void clear()
remove all the elements of the queue


remove

public void remove(nimPair _w)
remove the element from the queue


remove

public void remove(action act)
Remove the element from the queue that is equals to the specified action, independently of the turn


contains

public boolean contains(nimPair _w)
Tests if the specified object is a component in this queue.


contains

public boolean contains(actionset actid)
Tests if an object with the specified actionset is a component of this queue


contains

public boolean contains(action act)
Tests if the queue contains an element with the specified action, independently of the turn


contains

public boolean contains(actionset actid,
                        turn DP)
Test if the queue contains an element with the specified actionset and turn


contains

public boolean contains(attrval_ext ext)
Test if the queue contains an element with the specified attribute extension


contains

public boolean contains(actionset actid,
                        java.lang.String attr)
Test if the queue contains an element with the specified actionset and attribute name


contains

public boolean contains(actionset actid,
                        condition attr)
Test if the queue contains ALL the element with the specified actionset and attribute name of the condition


get

public action get(actionset actid)
Returns the first element found with the specified actionset


get

public action get(actionset actid,
                  turn DP)
Returns the first element found with the specified actionset and turn


get

public nimPair get(int i)
Returns the element at the specified position in this queue.


containsAll

public boolean containsAll(queueact queuesrc)
Tests if the current queue contains at least all the elements of the specified queue


getAll

public queueact getAll(actionset actid)
Returns all the actions in a queue that are of the specified actionset


ini_shift

public void ini_shift()
initialized the shift count


fully_shifted

public boolean fully_shifted()
all the elements of the queue has been head


shift

public void shift()
push the first element in the queue at the end


cancel_shift

public void cancel_shift()
abort shift count


size

public int size()
Returns the number of components in this queue.


search

public int search(nimPair nim)
Searches the index for the specified object.