|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
be.lassi.base
Class NamedObject
java.lang.Object be.lassi.base.SaveableObject 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 indicatorid
- the object identifiername
- the object name
NamedObject
public NamedObject(Dirty dirty, java.lang.String name)
- Create a new instance with given name.
- Parameters:
dirty
- the dirty indicatorname
- 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 classjava.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 classjava.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
|
Lighting Assistant 1.2 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |