|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Linear<ELTTYPE>
An interface describing the behavior of linear data structures, structures that that 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. The structure package provides several implementations of the Linear interface, each of which has its particular strengths and weaknesses.
Stack
,
Queue
Method Summary | |
---|---|
void |
add(ELTTYPE value)
Add a value to the structure. |
boolean |
empty()
Returns true iff the structure is empty. |
ELTTYPE |
get()
Preview the object to be removed. |
ELTTYPE |
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 |
---|
void add(ELTTYPE value)
add
in interface Structure<ELTTYPE>
value
- The value to be added to the structure.ELTTYPE get()
ELTTYPE remove()
int size()
size
in interface Structure<ELTTYPE>
boolean empty()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |