|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mwolff.struts.back.RingBuffer
public class RingBuffer
A Ringbuffer is a buffer to store something (in this case ArrayEntries). This buffer is made for the stuts back mechanism. Its supports also a wizzard manner to go back and forward more steps. This implementation simulates a ringbuffer. The Buffer has the following invariants:
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
Commons Logging instance. |
Constructor Summary | |
---|---|
RingBuffer()
Constructor with default entries (40). |
|
RingBuffer(int maxEntries)
Constructor with an amount of entries. |
Method Summary | |
---|---|
ArrayEntry |
back()
Goes one entry back into the ringbuffer. |
void |
clear()
Clears the buffer |
ArrayEntry |
forward()
Goes one entry forward in the ringbuffer. |
ArrayEntry |
getActIndex()
|
ArrayEntry |
getLastPushed()
Returns the last pushed entry. |
boolean |
isBackPossible()
|
boolean |
isForwardPossible()
|
boolean |
isNoPush()
Returns the NoPush Flag. |
boolean |
isOverflow()
Returns the overflow bit. |
boolean |
isWereInvolved()
Returns the WereInvolved Flag. |
void |
print()
|
int |
push(ArrayEntry entry)
Pushes an entry into the ringbuffer. |
void |
setNoPush(boolean noPush)
Sets the NoPush Flag. |
void |
setWereInvolved(boolean wereInvolved)
Sets the WereInvolved Flag. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
Commons Logging instance.
Constructor Detail |
---|
public RingBuffer()
public RingBuffer(int maxEntries)
maxEntries
- Entries of the ringbuffer.Method Detail |
---|
public boolean isForwardPossible()
public boolean isBackPossible()
public void print()
public void clear()
public int size()
public int push(ArrayEntry entry)
entry
- The entry to be pushed
public ArrayEntry back()
public ArrayEntry forward()
public ArrayEntry getLastPushed()
public ArrayEntry getActIndex()
public boolean isOverflow()
public boolean isNoPush()
public void setNoPush(boolean noPush)
noPush
- The NoPush Flag.public boolean isWereInvolved()
public void setWereInvolved(boolean wereInvolved)
wereInvolved
- The WereInvolved Flag.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |