structure
Interface Linear

All Superinterfaces:
Structure
All Known Subinterfaces:
Queue, Stack
All Known Implementing Classes:
AbstractLinear, AbstractQueue, AbstractStack, QueueArray, QueueList, QueueVector, StackArray, StackList, StackVector

public interface Linear
extends Structure

Linear classes are contains that have completely determined add and remove methods. Classic examples are stacks and queues.

See Also:
Stack, Queue

Method Summary
 void add(Object value)
          Add a value to the structure.
 boolean empty()
          Returns true iff the structure is empty.
 Object get()
          Preview the object to be removed.
 Object remove()
          Remove a value from the structure.
 int size()
          Returns the number of elements in the linear structure.
 
Methods inherited from interface structure.Structure
clear, contains, elements, isEmpty, iterator, remove, values
 

Method Detail

add

void add(Object value)
Add a value to the structure. The type of structure determines the location of the value added.

Specified by:
add in interface Structure
Parameters:
value - The value to be added to the structure.

get

Object get()
Preview the object to be removed.

Returns:
A reference to the next object to be removed.

remove

Object remove()
Remove a value from the structure. The particular value to be removed is determined by the structure.

Returns:
Value removed from structure.

size

int size()
Returns the number of elements in the linear structure.

Specified by:
size in interface Structure
Returns:
number of elements in structure.

empty

boolean empty()
Returns true iff the structure is empty.

Returns:
True iff the linear structure is empty.