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 newAppender
with the sameduration
for eachappendix
Appender(java.lang.CharSequence[] appendices, float[] durations)
Appender(java.lang.CharSequence appendices, float durations)
instantiates a newAppender
with bothappendices
anddurations
being 1 in length with the given value -
Method Summary
Modifier and Type Method Description java.lang.CharSequence
append(java.lang.CharSequence seq)
java.lang.CharSequence
append(java.lang.CharSequence seq, float time)
static java.lang.CharSequence
append(java.lang.CharSequence seq, java.lang.CharSequence appendix)
java.lang.CharSequence
appendixAt(float time)
static java.lang.CharSequence
appendixAt(float time, java.lang.CharSequence[] appendices, float[] durations)
the appendix fromappendices
at the giventime
indurations
java.lang.CharSequence[]
getAppendices()
float[]
getDurations()
int
getIndex()
float
getTime()
void
set(java.lang.CharSequence[] appendices, float durations)
sets the sameduration
for eachappendix
void
set(java.lang.CharSequence[] appendices, float[] durations)
appendices
anddurations
must be of the same lengthvoid
setAppendices(java.lang.CharSequence[] appendices)
void
setDurations(float[] durations)
void
setIndex(int index)
void
setTime(float time)
float
update(float delta)
updatestime
andindex
java.lang.CharSequence
updateAndAppend(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 newAppender
with bothappendices
anddurations
being 1 in length with the given value -
Appender
public Appender(java.lang.CharSequence[] appendices, float durations)instantiates a newAppender
with the sameduration
for eachappendix
-
Appender
public Appender(java.lang.CharSequence[] appendices, float[] durations)- Parameters:
appendices
- theappendices
durations
- thedurations
-
-
Method Details
-
append
public static java.lang.CharSequence append(java.lang.CharSequence seq, java.lang.CharSequence appendix)- Parameters:
seq
- theCharSequence
on which to appendappendix
appendix
- theCharSequence
to append- Returns:
seq
withappendix
appended
-
appendixAt
public static java.lang.CharSequence appendixAt(float time, java.lang.CharSequence[] appendices, float[] durations)the appendix fromappendices
at the giventime
indurations
-
update
public float update(float delta)updatestime
andindex
- 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
CharSequence
representing the givenseq
with the value ofappendices
atindex
appended
-
append
public java.lang.CharSequence append(java.lang.CharSequence seq, float time)- Returns:
- a
CharSequence
representing the givenseq
with theappendix at
time
appended
-
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)appendices
anddurations
must be of the same length- Parameters:
appendices
- theappendices
to setdurations
- thedurations
to set
-
set
public void set(java.lang.CharSequence[] appendices, float durations)sets the sameduration
for eachappendix
-
getAppendices
public java.lang.CharSequence[] getAppendices()- Returns:
- the
appendices
-
setAppendices
public void setAppendices(java.lang.CharSequence[] appendices)- Parameters:
appendices
- theappendices
to set
-
getDurations
public float[] getDurations()- Returns:
- the
durations
-
setDurations
public void setDurations(float[] durations)- Parameters:
durations
- thedurations
to set
-
getTime
public float getTime()- Returns:
- the
time
-
setTime
public void setTime(float time)- Parameters:
time
- thetime
to set
-
getIndex
public int getIndex()- Returns:
- the
index
-
setIndex
public void setIndex(int index)- Parameters:
index
- theindex
to set
-