structure
Class AbstractLinear<ELTTYPE>

java.lang.Object
  extended by structure.AbstractStructure<ELTTYPE>
      extended by structure.AbstractLinear<ELTTYPE>
All Implemented Interfaces:
java.lang.Iterable<ELTTYPE>, Linear<ELTTYPE>, Structure<ELTTYPE>
Direct Known Subclasses:
AbstractQueue, AbstractStack

public abstract class AbstractLinear<ELTTYPE>
extends AbstractStructure<ELTTYPE>
implements Linear<ELTTYPE>

An abstract implemtation of linear data structures. Linear structures have completely determined add and remove methods. Linear structures are often used to store the the state of a recursively solved problem and stacks and queues are classic examples of such structures.

See Also:
Stack, Queue

Constructor Summary
AbstractLinear()
           
 
Method Summary
 boolean empty()
          Determine if there are elements within the linear.
 ELTTYPE remove(ELTTYPE o)
          Removes value from the linear structure.
 
Methods inherited from class structure.AbstractStructure
contains, elements, hashCode, isEmpty, values
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface structure.Linear
add, get, remove, size
 
Methods inherited from interface structure.Structure
clear, contains, elements, isEmpty, iterator, values
 

Constructor Detail

AbstractLinear

public AbstractLinear()
Method Detail

empty

public boolean empty()
Determine if there are elements within the linear.

Specified by:
empty in interface Linear<ELTTYPE>
Returns:
true if the linear structure is empty; false otherwise
Post:
return true iff the linear structure is empty

remove

public ELTTYPE remove(ELTTYPE o)
Removes value from the linear structure. Not implemented (by default) for linear classes.

Specified by:
remove in interface Structure<ELTTYPE>
Parameters:
value - value matching the value to be removed
Returns:
returns the value that was replaced, or null if none.
Pre:
value is non-null
Post:
value is removed from linear structure, if it was there