|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.base.CommandStream
public class CommandStream
Represents a stream of commands. It is useful for implementing undoable operations in applications.
Constructor Summary | |
---|---|
CommandStream()
Initializes a new CommandStream object with unlimited size. |
Method Summary | |
---|---|
Command |
backward()
Returns the next command for which an undo operation is meaningful and consistent with respect to the order of the commands registered. |
boolean |
backwardPossible()
Returns true iff it is possible to retrieve
a command by calling backward() . |
void |
clear()
Clears this stream. |
void |
clearTo(Command com)
Clears the stream up to the given command (exclusive). |
Command |
forward()
Returns the next command for which a redo operation is meaningful and consistent with respect to the order of the commands registered. |
boolean |
forwardPossible()
Returns true iff it is possible to retrieve
a command by calling forward() . |
java.lang.Object |
getActiveToken()
Obtains a token which determines the currently active position in the stream. |
int |
getMaximumSize()
Returns the maximum size of this stream. |
boolean |
isActiveToken(java.lang.Object token)
Determines whether the stream is currently at the same position as it was at the time that the token has been obtained using getActiveToken() . |
void |
push(Command com)
Adds the given command to this stream. |
void |
setMaximumSize(int maxSize)
Sets the maximum size of this stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandStream()
Method Detail |
---|
public void setMaximumSize(int maxSize)
public int getMaximumSize()
public void push(Command com)
public boolean backwardPossible()
true
iff it is possible to retrieve
a command by calling backward()
.
public void clearTo(Command com)
public void clear()
public Command backward()
null
is returned.
public boolean forwardPossible()
true
iff it is possible to retrieve
a command by calling forward()
.
public Command forward()
null
is returned.
public java.lang.Object getActiveToken()
isActiveToken(Object)
can be used to determine whether the
current stream position equals the position at the time the token was
obtained.
public boolean isActiveToken(java.lang.Object token)
getActiveToken()
.
token
- The token.
true
if the stream is at the same position.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |