fr.inria.opengve.tools.dataStructures.interfaces
Interface Accumulator<E>

All Known Implementing Classes:
Fifo, Stack

public interface Accumulator<E>

This interface define object like FIFO and LIFO. With this type of object we can make add, remove and look next element operation but you can't make random access or know if an object is already present.

Author:
fpeix

Method Summary
 void clear()
          Remove all the elements of the data structure.
 E get()
          Remove and give the first object of the data structure.
 boolean isEmpty()
          Tell if the data structure contains element.
 E look()
          Give the next element return by get() without removing it from the data structure.
 void put(E o)
          Add a object to the data structure.
 int size()
          Return the number of element contained in the data structure.
 

Method Detail

get

E get()
Remove and give the first object of the data structure.

Returns:
One object.
Throws:
java.util.NoSuchElementException - If the data structure is empty.

look

E look()
Give the next element return by get() without removing it from the data structure.

Returns:
The next element returned by get()}.

put

void put(E o)
Add a object to the data structure.

Parameters:
o - The object to add.

isEmpty

boolean isEmpty()
Tell if the data structure contains element.

Returns:
true if the data structure is empty and false otherwise.

clear

void clear()
Remove all the elements of the data structure.


size

int size()
Return the number of element contained in the data structure.

Returns:
The size of the data structure.


Copyright © 2009 INRIA (Projet Mascotte). All Rights Reserved.