be.lassi.cues
Class CueNumberGenerator
java.lang.Object
be.lassi.cues.CueNumberGenerator
public class CueNumberGenerator
- extends java.lang.Object
Generates default numbers for new Cue
s that are
added to Cues
collections.
These are the rules:
- Cues inserted at the start always get number 1.
- Cues added at the end get the next higher integer number.
- Cues inserted get the next higher number, unless
this is a higher number than the next cue; in that case
-1 is added to the previous number.
Method Summary |
java.lang.String |
getNumber(int cueIndex)
Gets a default number for a cue inserted at given index. |
void |
renumber(int firstCueNumber,
int increment,
boolean selected)
Renumbers all cues. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CueNumberGenerator
public CueNumberGenerator(Cues cues)
- Constructs a new cue number generator.
- Parameters:
cues
- the cue collection in which new cues are inserted
getNumber
public java.lang.String getNumber(int cueIndex)
- Gets a default number for a cue inserted at given index.
- Parameters:
cueIndex
- the index at which the cue will be inserted
- Returns:
- the default cue number
renumber
public void renumber(int firstCueNumber,
int increment,
boolean selected)
- Renumbers all cues.
- Parameters:
firstCueNumber
- the cue number for the first cueincrement
- the cue number incrementselected
- indicates whether only selected cues should be renumbered