Class LBody

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<LSemaphore>
              extended by LBody
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<LSemaphore>, java.util.Collection<LSemaphore>, java.util.List<LSemaphore>, java.util.RandomAccess

public class LBody
extends java.util.ArrayList<LSemaphore>

The Class LBody that symbolizes the body of the looper.

See Also:
Serialized Form

Constructor Summary
LBody(LSemaphore s)
          Instantiates a new looper body.
 
Method Summary
 int getHeadX()
          Gets the head x.
 int getHeadY()
          Gets the head y.
 void move(LSemaphore[] s)
          Moves all the elements of the looper.
 void releaseAll()
          Release all.
 void removeTail()
          Removes the tail.
 boolean updateHead(LSemaphore s)
          Adds the new semaphore as the head of the body
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

LBody

public LBody(LSemaphore s)
Instantiates a new looper body.

Parameters:
s - the semaphore
Method Detail

move

public void move(LSemaphore[] s)
Moves all the elements of the looper.

Parameters:
s - the semaphore

updateHead

public boolean updateHead(LSemaphore s)
Adds the new semaphore as the head of the body

Parameters:
s - the semaphore
Returns:
true, if successful

removeTail

public void removeTail()
Removes the tail.


releaseAll

public void releaseAll()
Release all. Called when looper eaten.


getHeadX

public int getHeadX()
Gets the head x.

Returns:
the head x

getHeadY

public int getHeadY()
Gets the head y.

Returns:
the head y