be.lassi.domain
Class Submaster
java.lang.Object
be.lassi.base.SaveableObject
be.lassi.base.NamedObject
be.lassi.domain.LevelObject
be.lassi.domain.Controlable
be.lassi.domain.Submaster
public class Submaster
- extends Controlable
Represents the state of all channels at a given moment.
This class is basically a collection of Level
objects with a name.
Constructor Summary |
Submaster(Dirty dirty,
int id,
int channelCount,
java.lang.String name)
Constructs a new instance with given name and number of Levels. |
Submaster(Dirty dirty,
int id,
java.lang.String name,
float[] levelValues)
Constructs a new instance with given name and level values. |
Submaster(int channelCount,
java.lang.String name)
Constructs a new instance with given name and number of Levels. |
Method Summary |
boolean |
equals(java.lang.Object object)
|
java.lang.String |
getComment()
|
static java.lang.String |
getDefaultName(int id)
|
java.lang.String |
getLabel()
Gets the text to be shown on the Sheet table row. |
Level |
getLevel(int channelIndex)
Gets the Level at given index. |
float |
getLevelValue(int channelIndex)
Gets the value of the channel level at given index. |
int |
getNumberOfLevels()
Get the number of channels covered by the submaster. |
boolean |
hasLevelValues()
Return true is there is a level with a non-zero value. |
boolean |
isChannelActive(int channelIndex)
|
boolean |
isUsed()
Indicates whether this submaster is in use. |
void |
set(Submaster submaster)
Set the information in this submaster to the information in given
submaster (including submaster name and level values). |
void |
setComment(java.lang.String comment)
|
void |
setLevelValue(int channelIndex,
float level)
The the level value of the channel at given index. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Submaster
public Submaster(Dirty dirty,
int id,
int channelCount,
java.lang.String name)
- Constructs a new instance with given name and number of
Levels.
- Parameters:
dirty
- the dirty indicatorchannelCount
- name
-
Submaster
public Submaster(Dirty dirty,
int id,
java.lang.String name,
float[] levelValues)
- Constructs a new instance with given name and level values.
- Parameters:
dirty
- the dirty indicatorname
- levelValues
-
Submaster
public Submaster(int channelCount,
java.lang.String name)
- Constructs a new instance with given name and number of
Levels.
- Parameters:
channelCount
- name
-
equals
public boolean equals(java.lang.Object object)
-
- Overrides:
equals
in class LevelObject
getComment
public java.lang.String getComment()
getDefaultName
public static java.lang.String getDefaultName(int id)
getLabel
public java.lang.String getLabel()
- Description copied from class:
Controlable
- Gets the text to be shown on the Sheet table row.
- Specified by:
getLabel
in class Controlable
- Returns:
- the Sheet row text
getLevel
public Level getLevel(int channelIndex)
- Gets the
Level
at given index.
- Parameters:
channelIndex
- the index in the Level
collection.
- Returns:
- Level the
Level
at given index.
getLevelValue
public float getLevelValue(int channelIndex)
- Gets the value of the channel level at given index.
- Parameters:
channelIndex
- the channel index
- Returns:
- float the channel level value
getNumberOfLevels
public int getNumberOfLevels()
- Get the number of channels covered by the submaster.
- Returns:
- int the channel count
hasLevelValues
public boolean hasLevelValues()
- Return true is there is a level with a non-zero value.
- Returns:
isChannelActive
public boolean isChannelActive(int channelIndex)
isUsed
public boolean isUsed()
- Indicates whether this submaster is in use.
- Returns:
- true if this submaster is in use
set
public void set(Submaster submaster)
- Set the information in this submaster to the information in given
submaster (including submaster name and level values).
- Parameters:
submaster
-
setComment
public void setComment(java.lang.String comment)
setLevelValue
public void setLevelValue(int channelIndex,
float level)
- The the level value of the channel at given index.
- Parameters:
channelIndex
- level
-
toString
public java.lang.String toString()
-
- Overrides:
toString
in class java.lang.Object