Class AbstractLinear<E>

  extended by structure5.AbstractStructure<E>
      extended by structure5.AbstractLinear<E>
All Implemented Interfaces:
Iterable<E>, Linear<E>, Structure<E>
Direct Known Subclasses:
AbstractQueue, AbstractStack

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

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:
structure.Stack, structure.Queue

Constructor Summary
Method Summary
 boolean empty()
          Determine if there are elements within the linear.
 E remove(E o)
          Removes value from the linear structure.
Methods inherited from class structure5.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 structure5.Linear
add, get, remove, size
Methods inherited from interface structure5.Structure
clear, contains, elements, isEmpty, iterator, values

Constructor Detail


public AbstractLinear()
Method Detail


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

Specified by:
empty in interface Linear<E>
true if the linear structure is empty; false otherwise


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

Specified by:
remove in interface Structure<E>
value - value matching the value to be removed
returns the value that was replaced, or null if none.