|
© 1998-2002 McGraw-Hill | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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(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 |
public void add(Object value)
add
in interface Structure
value
- The value to be added to the structure.public Object get()
public Object remove()
public int size()
size
in interface Structure
public boolean empty()
|
© 1998-2002 McGraw-Hill | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |