|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.j2r.FiFoStrategy
public class FiFoStrategy
| Constructor Summary | |
|---|---|
FiFoStrategy(ManagedMap map,
int size)
Creates a new instance with the specified storage. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears all elements. |
java.lang.Object |
clone()
Creates a shallow copy of this object, preserving the internal structure by copying only references. |
void |
decrease(int index,
java.lang.Object key)
Removes the element with the specified key or index. |
void |
freshenSequence(java.lang.Object key,
java.lang.Object value)
Freshens the sequence of the element value if
value is not null. |
java.lang.Object |
get(int index)
Returns the key at the specified index. |
ManagedMap |
getManagedMap()
|
void |
increase(java.lang.Object key,
java.lang.Object prevValue,
java.lang.Object newValue)
Stores the provided key/value pair. |
int |
indexOf(java.lang.Object key)
Returns the index of the specified key. |
java.util.Iterator |
iterator()
Returns a key iterator. |
int |
lastIndexOf(java.lang.Object key)
Returns the last index of the specified key. |
void |
removeManagedMap()
|
java.util.List |
sequence()
Returns the ordered sequence of keys. |
void |
setManagedMap(ManagedMap managedMap)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FiFoStrategy(ManagedMap map,
int size)
size - The storage to allocate up front.| Method Detail |
|---|
public void clear()
clear in interface MapManagerStrategypublic java.lang.Object clone()
clone()'d.
clone in interface MapManagerStrategyclone in class java.lang.Object
public void freshenSequence(java.lang.Object key,
java.lang.Object value)
value if
value is not null.
freshenSequence in interface MapManagerStrategykey - The key whose sequence to freshen.value - The value whose existance to check before removing the old
key sequence.public java.lang.Object get(int index)
get in interface MapManagerStrategypublic int indexOf(java.lang.Object key)
indexOf in interface MapManagerStrategypublic java.util.Iterator iterator()
iterator in interface MapManagerStrategypublic int lastIndexOf(java.lang.Object key)
lastIndexOf in interface MapManagerStrategy
public void increase(java.lang.Object key,
java.lang.Object prevValue,
java.lang.Object newValue)
increase in interface MapManagerStrategykey - The key to the provided value.value - The value to store.
public final void decrease(int index,
java.lang.Object key)
decrease in interface MapManagerStrategyindex - The index of the object to remove, or
UNKNOWN_INDEX if not known.key - The Map key of the object to remove.public java.util.List sequence()
## $table contains a sequenced map #foreach ($key in $table.sequence()) <TR> <TD>Key: $key</TD> </TD>Value: $table.get($key)</TD> </TR> #end
sequence in interface MapManagerStrategypublic ManagedMap getManagedMap()
getManagedMap in interface MapManagerStrategypublic void setManagedMap(ManagedMap managedMap)
setManagedMap in interface MapManagerStrategypublic void removeManagedMap()
removeManagedMap in interface MapManagerStrategy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||