Package net.dermetfan.utils
Class Appender
java.lang.Object
net.dermetfan.utils.Appender
Appends its
appendices to a CharSequence. Determines which is the current appendix from time and durations.-
Constructor Summary
ConstructorsConstructorDescriptionAppender(CharSequence[] appendices, float durations) instantiates a newAppenderwith the samedurationfor eachappendixAppender(CharSequence[] appendices, float[] durations) Appender(CharSequence appendices, float durations) instantiates a newAppenderwith bothappendicesanddurationsbeing 1 in length with the given value -
Method Summary
Modifier and TypeMethodDescriptionappend(CharSequence seq) append(CharSequence seq, float time) static CharSequenceappend(CharSequence seq, CharSequence appendix) appendixAt(float time) static CharSequenceappendixAt(float time, CharSequence[] appendices, float[] durations) the appendix fromappendicesat the giventimeindurationsfloat[]intgetIndex()floatgetTime()voidset(CharSequence[] appendices, float durations) sets the samedurationfor eachappendixvoidset(CharSequence[] appendices, float[] durations) appendicesanddurationsmust be of the same lengthvoidsetAppendices(CharSequence[] appendices) voidsetDurations(float[] durations) voidsetIndex(int index) voidsetTime(float time) floatupdate(float delta) updatestimeandindexupdateAndAppend(CharSequence seq, float delta)
-
Constructor Details
-
Appender
instantiates a newAppenderwith bothappendicesanddurationsbeing 1 in length with the given value -
Appender
instantiates a newAppenderwith the samedurationfor eachappendix -
Appender
- Parameters:
appendices- theappendicesdurations- thedurations
-
-
Method Details
-
append
- Parameters:
seq- theCharSequenceon which to appendappendixappendix- theCharSequenceto append- Returns:
seqwithappendixappended
-
appendixAt
the appendix fromappendicesat the giventimeindurations -
update
public float update(float delta) updatestimeandindex- Parameters:
delta- the amount to add totime- Returns:
- the updated
index
-
appendixAt
- Returns:
- the appendix at the given
time
-
append
- Returns:
- a
CharSequencerepresenting the givenseqwith the value ofappendicesatindexappended
-
append
- Returns:
- a
CharSequencerepresenting the givenseqwith theappendix attimeappended
-
updateAndAppend
- See Also:
-
set
appendicesanddurationsmust be of the same length- Parameters:
appendices- theappendicesto setdurations- thedurationsto set
-
set
sets the samedurationfor eachappendix -
getAppendices
- Returns:
- the
appendices
-
setAppendices
- Parameters:
appendices- theappendicesto set
-
getDurations
public float[] getDurations()- Returns:
- the
durations
-
setDurations
public void setDurations(float[] durations) - Parameters:
durations- thedurationsto set
-
getTime
public float getTime()- Returns:
- the
time
-
setTime
public void setTime(float time) - Parameters:
time- thetimeto set
-
getIndex
public int getIndex()- Returns:
- the
index
-
setIndex
public void setIndex(int index) - Parameters:
index- theindexto set
-