All Packages Class Hierarchy This Package Previous Next Index
Interface structure.Linear
- public interface Linear
- extends Store
Linear classes are contains that have completely determined
add and remove methods. Classic examples are stacks and queues.
- See Also:
- Stack, Queue
add(Object)
- Add a value to the structure.
peek()
- Preview the object to be removed.
remove()
- Remove a value from the structure.
add
public abstract void add(Object value)
- Add a value to the structure. The type of structure determines
the location of the value added.
- Precondition:
- value is non-null
- Postcondition:
- the value is added to the collection,
the consistent replacement policy not specified.
- Parameters:
- value - The value to be added to the structure.
peek
public abstract Object peek()
- Preview the object to be removed.
- Precondition:
- structure is not empty
- Postcondition:
- returns reference to next object to be removed.
- Returns:
- A reference to the next object to be removed.
remove
public abstract Object remove()
- Remove a value from the structure. The particular value
to be removed is determined by the structure.
- Precondition:
- structure is not empty.
- Postcondition:
- removes an object from store
- Returns:
- Value removed from structure.
All Packages Class Hierarchy This Package Previous Next Index