Package net.dermetfan.utils
Class Appender
java.lang.Object
net.dermetfan.utils.Appender
public class Appender
extends java.lang.Object
Appends its
appendices to a CharSequence. Determines which is the current appendix from time and durations.-
Constructor Summary
Constructors Constructor Description Appender(java.lang.CharSequence[] appendices, float durations)instantiates a newAppenderwith the samedurationfor eachappendixAppender(java.lang.CharSequence[] appendices, float[] durations)Appender(java.lang.CharSequence appendices, float durations)instantiates a newAppenderwith bothappendicesanddurationsbeing 1 in length with the given value -
Method Summary
Modifier and Type Method Description java.lang.CharSequenceappend(java.lang.CharSequence seq)java.lang.CharSequenceappend(java.lang.CharSequence seq, float time)static java.lang.CharSequenceappend(java.lang.CharSequence seq, java.lang.CharSequence appendix)java.lang.CharSequenceappendixAt(float time)static java.lang.CharSequenceappendixAt(float time, java.lang.CharSequence[] appendices, float[] durations)the appendix fromappendicesat the giventimeindurationsjava.lang.CharSequence[]getAppendices()float[]getDurations()intgetIndex()floatgetTime()voidset(java.lang.CharSequence[] appendices, float durations)sets the samedurationfor eachappendixvoidset(java.lang.CharSequence[] appendices, float[] durations)appendicesanddurationsmust be of the same lengthvoidsetAppendices(java.lang.CharSequence[] appendices)voidsetDurations(float[] durations)voidsetIndex(int index)voidsetTime(float time)floatupdate(float delta)updatestimeandindexjava.lang.CharSequenceupdateAndAppend(java.lang.CharSequence seq, float delta)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Appender
public Appender(java.lang.CharSequence appendices, float durations)instantiates a newAppenderwith bothappendicesanddurationsbeing 1 in length with the given value -
Appender
public Appender(java.lang.CharSequence[] appendices, float durations)instantiates a newAppenderwith the samedurationfor eachappendix -
Appender
public Appender(java.lang.CharSequence[] appendices, float[] durations)- Parameters:
appendices- theappendicesdurations- thedurations
-
-
Method Details
-
append
public static java.lang.CharSequence append(java.lang.CharSequence seq, java.lang.CharSequence appendix)- Parameters:
seq- theCharSequenceon which to appendappendixappendix- theCharSequenceto append- Returns:
seqwithappendixappended
-
appendixAt
public static java.lang.CharSequence appendixAt(float time, java.lang.CharSequence[] appendices, float[] durations)the appendix fromappendicesat the giventimeindurations -
update
public float update(float delta)updatestimeandindex- Parameters:
delta- the amount to add totime- Returns:
- the updated
index
-
appendixAt
public java.lang.CharSequence appendixAt(float time)- Returns:
- the appendix at the given
time
-
append
public java.lang.CharSequence append(java.lang.CharSequence seq)- Returns:
- a
CharSequencerepresenting the givenseqwith the value ofappendicesatindexappended
-
append
public java.lang.CharSequence append(java.lang.CharSequence seq, float time)- Returns:
- a
CharSequencerepresenting the givenseqwith theappendix attimeappended
-
updateAndAppend
public java.lang.CharSequence updateAndAppend(java.lang.CharSequence seq, float delta)- See Also:
update(float),append(CharSequence)
-
set
public void set(java.lang.CharSequence[] appendices, float[] durations)appendicesanddurationsmust be of the same length- Parameters:
appendices- theappendicesto setdurations- thedurationsto set
-
set
public void set(java.lang.CharSequence[] appendices, float durations)sets the samedurationfor eachappendix -
getAppendices
public java.lang.CharSequence[] getAppendices()- Returns:
- the
appendices
-
setAppendices
public void setAppendices(java.lang.CharSequence[] appendices)- 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
-