LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.misc
Class LyLastValues

java.lang.Object
  extended by leon.misc.LyLastValues

public class LyLastValues
extends java.lang.Object

Utility class used to keep a list of last accessed values corresponding to keys.


Field Summary
static java.lang.String __VERSION
           
static int DEFAULT_SIZE
          Default number of elements stored into the list.
static java.lang.Object NOT_FOUND
          Default object returned when the object corresponding to a key is not found.
 
Constructor Summary
LyLastValues()
          Constructor.
LyLastValues(int size)
          Constructor.
 
Method Summary
 void addValue(java.lang.Object key, java.lang.Object value)
          Adds a pair (key, value) to last accessed values list.
 java.lang.Object getValue(java.lang.Object key)
          Finds the value corresponding to the given key.
 java.lang.Object removeValue(java.lang.Object key)
          Removes value corresponding to given key.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

DEFAULT_SIZE

public static int DEFAULT_SIZE
Default number of elements stored into the list.


NOT_FOUND

public static final java.lang.Object NOT_FOUND
Default object returned when the object corresponding to a key is not found.

Constructor Detail

LyLastValues

public LyLastValues()
Constructor. Calls LyLastValues(DEFAULT_SIZE)


LyLastValues

public LyLastValues(int size)
Constructor. Creates the keys list and the values list of the given size.

Parameters:
size - the number of objects to store
Method Detail

addValue

public void addValue(java.lang.Object key,
                     java.lang.Object value)
Adds a pair (key, value) to last accessed values list.

Parameters:
key - the key to add
value - the value to add

getValue

public java.lang.Object getValue(java.lang.Object key)
Finds the value corresponding to the given key.

Parameters:
key - the key
Returns:
The value if found, NOT_FOUND otherwise.

removeValue

public java.lang.Object removeValue(java.lang.Object key)
Removes value corresponding to given key.

Parameters:
key - the key
Returns:
The removed value if found, NOT_FOUND otherwise.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com