gishur.core
Class StdListItem

java.lang.Object
  |
  +--gishur.core.BasicListItem
        |
        +--gishur.core.StdListItem
All Implemented Interfaces:
java.lang.Cloneable, Cloneable, ControlledCloneable, KeyValueHolder, ListItem, java.io.Serializable
Direct Known Subclasses:
FibonacciNode

public class StdListItem
extends BasicListItem

A standard ListItem. It is based upon BasicListItem, but additionally stores a key and a value.

Version:
1.0
Author:
Thomas Wolf
See Also:
Serialized Form

Fields inherited from interface gishur.core.ListItem
CLEAR_CONNECTIONS, CONNECT_BACKWARD, CONNECT_FORWARD, REMOVE, SET_OWNER
 
Fields inherited from interface gishur.core.KeyValueHolder
SET_KEY, SET_VALUE
 
Fields inherited from interface gishur.core.ControlledCloneable
DEEP, FLAT
 
Constructor Summary
StdListItem()
          Standard constructor.
StdListItem(java.lang.Object key, java.lang.Object value)
          Constructor initializing key and value. {
 
Method Summary
 java.lang.Object key()
          Returns the key.
 boolean setKey(java.lang.Object key)
          Sets the key.
 boolean setValue(java.lang.Object object)
          Tries store object in this StdListItem.
 java.lang.String toString()
          Overrides java.lang.Object.toString().
 java.lang.Object value()
          Returns the stored value-object.
 
Methods inherited from class gishur.core.BasicListItem
answerConnect, clearConnections, clone, clone, connect, equals, find, findFirst, findLast, getIndex, getOwningList, isFirst, isLast, next, prev, remove, requestListAccess, setOwningList
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StdListItem

public StdListItem()
Standard constructor. Key and value will be set to null.

StdListItem

public StdListItem(java.lang.Object key,
                   java.lang.Object value)
Constructor initializing key and value. BasicList.requestAccess(int, java.lang.Object, java.lang.Object) will not be called for initialization!
Parameters:
key - new key-object
value - the value to store in the new StdListItem
Method Detail

toString

public java.lang.String toString()
Overrides java.lang.Object.toString().
Overrides:
toString in class BasicListItem

key

public java.lang.Object key()
Returns the key.
Overrides:
key in class BasicListItem
Returns:
the stored key-object

setKey

public boolean setKey(java.lang.Object key)
Sets the key.
Overrides:
setKey in class BasicListItem
Parameters:
key - new key-object of this StdListItem
Returns:
true, if the key was set successfully, i.e if access was granted by the Owner and false otherwise

value

public java.lang.Object value()
Returns the stored value-object.
Overrides:
value in class BasicListItem
Returns:
stored value

setValue

public boolean setValue(java.lang.Object object)
Tries store object in this StdListItem.
Overrides:
setValue in class BasicListItem
Parameters:
object - the object to store
Returns:
true if the Owner allowed this action and it was performed successfullly, false otherwise