|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JList | +--kiwi.ui.StackView
A component that displays the contents of a Stack
data
structure. This is an MVC class that uses a StackModel
as its
data model.
StackModel
,
java.util.Stack
, Serialized FormInner classes inherited from class javax.swing.JList |
JList.AccessibleJList |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
StackView()
Construct a new StackView with a default stack model. |
|
StackView(StackModel model)
Construct a new StackView with the given stack model. |
Method Summary | |
void |
append(Object obj)
Append an item to the stack. |
void |
drop()
Drop the top item off the stack. |
int |
getDepth()
Return the depth of the stack. |
StackModel |
getStackModel()
Get the model used by this StackView . |
boolean |
isEmpty()
Check if the stack is empty. |
Object |
peek()
Peek at the top item on the stack. |
Object |
pick(int index)
Remove an item from the stack. |
Object |
pop()
Pop an item off the stack. |
void |
push(Object obj)
Push a new item on the stack. |
void |
replace(Object obj)
Replace the top item on the stack. |
void |
swap()
Swap the positions of the top two items on the stack. |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setLayout,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public StackView()
StackView
with a default stack model.public StackView(StackModel model)
StackView
with the given stack model.model
- The StackModel
to use.Method Detail |
public StackModel getStackModel()
StackView
.public void push(Object obj)
obj
- The object to push on the stack.public Object pop() throws EmptyStackException
public void drop() throws EmptyStackException
public Object peek()
public void swap() throws EmptyStackException
public int getDepth()
public boolean isEmpty()
public Object pick(int index) throws ArrayIndexOutOfBoundsException
index
- The index of the item to remove.index
is out of range.public void append(Object obj)
obj
- The item to add to the bottom of the stack.public void replace(Object obj)
obj
. If the stack is empty, the item is merely
pushed on the stack.obj
- The new item.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |