Overview  Package   Class  Tree  Index 

be.lassi.base
Class Holder<E>

java.lang.Object
  extended by be.lassi.base.AbstractHolder
      extended by be.lassi.base.Holder<E>
Type Parameters:
E - the type of object that is wrapped by this value holder
All Implemented Interfaces:
NamedValue, java.io.Serializable
Direct Known Subclasses:
StringHolder

public class Holder<E>
extends AbstractHolder

Generic implementation of an object value holder.

See Also:
Serialized Form

Constructor Summary
Holder()
          Constructs a new instance.
Holder(java.lang.String name)
          Constructs a new instance.
Holder(java.lang.String name, E value)
          Constructs a new instance on given value.
 
Method Summary
 void add(Listener listener)
          Adds a new listener.
 boolean equals(java.lang.Object object)
          
 java.lang.String getStringValue()
          Gets the value in string format.
 E getValue()
          Gets the value.
 int hashCode()
          
 void printListeners()
          Prints the listeners on stdout.
 void remove(Listener listener)
          Removes given listener.
 void setStringValue(java.lang.String newValue)
          Sets the value in string format.
 void setValue(E value2)
          Sets a new value.
 void setValue(E newValue, Listener doNotNotify)
          Sets a new value.
 
Methods inherited from class be.lassi.base.AbstractHolder
getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Holder

public Holder()
Constructs a new instance.


Holder

public Holder(java.lang.String name)
Constructs a new instance.

Parameters:
name - the value holder name

Holder

public Holder(java.lang.String name,
              E value)
Constructs a new instance on given value.

Parameters:
name - the value holder name
value - the initial value
Method Detail

add

public void add(Listener listener)
Adds a new listener.

Parameters:
listener - the listener to be added

equals

public boolean equals(java.lang.Object object)

Overrides:
equals in class AbstractHolder

getStringValue

public java.lang.String getStringValue()
Gets the value in string format.

Returns:
the value in string format

getValue

public E getValue()
Gets the value.

Returns:
the value

hashCode

public int hashCode()

Overrides:
hashCode in class AbstractHolder

printListeners

public void printListeners()
Prints the listeners on stdout. Can be usefull for debugging.


remove

public void remove(Listener listener)
Removes given listener.

Parameters:
listener - the listener to be removed

setStringValue

public void setStringValue(java.lang.String newValue)
Sets the value in string format.

Parameters:
newValue - the value to be set in string format

setValue

public void setValue(E value2)
Sets a new value.

Parameters:
value2 - the new value to set

setValue

public void setValue(E newValue,
                     Listener doNotNotify)
Sets a new value.

Parameters:
newValue - the new value to set
doNotNotify - the listener that does not have to be notified about this value change

Overview  Package   Class  Tree  Index 
Lighting Assistant 1.2