Overview  Package   Class  Tree  Index 

be.lassi.base
Class NamedObject

java.lang.Object
  extended by be.lassi.base.SaveableObject
      extended by be.lassi.base.NamedObject
Direct Known Subclasses:
LevelObject, Show

public class NamedObject
extends SaveableObject

Super class for classes where the instances should get a name. The class provides logic for NameListener objects to listen to name changes.


Constructor Summary
NamedObject(Dirty dirty)
          Constructs a new object with the default name "Unnamed".
NamedObject(Dirty dirty, int id, java.lang.String name)
          Constructs a new instance with given name and identifier.
NamedObject(Dirty dirty, java.lang.String name)
          Create a new instance with given name.
 
Method Summary
 void addNameListener(NameListener listener)
          Adds a listener.
 boolean equals(java.lang.Object object)
          
 int getId()
          Gets the object identifier.
 java.lang.String getName()
          Gets the object name.
 int hashCode()
          
 void removeNameListener(NameListener listener)
          Removes a name listener that was added before.
 void setName(java.lang.String name)
          Sets the object name.
 
Methods inherited from class be.lassi.base.SaveableObject
doNotMarkDirty, getDirty, isDirty, markDirty, setDirty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedObject

public NamedObject(Dirty dirty)
Constructs a new object with the default name "Unnamed".

Parameters:
dirty - the dirty indicator

NamedObject

public NamedObject(Dirty dirty,
                   int id,
                   java.lang.String name)
Constructs a new instance with given name and identifier.

Parameters:
dirty - the dirty indicator
id - the object identifier
name - the object name

NamedObject

public NamedObject(Dirty dirty,
                   java.lang.String name)
Create a new instance with given name.

Parameters:
dirty - the dirty indicator
name - the name of the object.
Method Detail

addNameListener

public void addNameListener(NameListener listener)
Adds a listener.

Parameters:
listener - the listener to be added

equals

public boolean equals(java.lang.Object object)

Overrides:
equals in class java.lang.Object

getId

public int getId()
Gets the object identifier.

Returns:
int the object identifier

getName

public java.lang.String getName()
Gets the object name.

Returns:
the object name

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

removeNameListener

public void removeNameListener(NameListener listener)
Removes a name listener that was added before.

Parameters:
listener - the listener to be removed

setName

public void setName(java.lang.String name)
Sets the object name. Listeners are notified of the change.

Parameters:
name - the new object name

Overview  Package   Class  Tree  Index 
Lighting Assistant 1.2