Class Appender

java.lang.Object
net.dermetfan.utils.Appender

public class Appender extends Object
Appends its appendices to a CharSequence. Determines which is the current appendix from time and durations.
  • Constructor Details

    • Appender

      public Appender(CharSequence appendices, float durations)
      instantiates a new Appender with both appendices and durations being 1 in length with the given value
    • Appender

      public Appender(CharSequence[] appendices, float durations)
      instantiates a new Appender with the same duration for each appendix
    • Appender

      public Appender(CharSequence[] appendices, float[] durations)
      Parameters:
      appendices - the appendices
      durations - the durations
  • Method Details

    • append

      public static CharSequence append(CharSequence seq, CharSequence appendix)
      Parameters:
      seq - the CharSequence on which to append appendix
      appendix - the CharSequence to append
      Returns:
      seq with appendix appended
    • appendixAt

      public static CharSequence appendixAt(float time, CharSequence[] appendices, float[] durations)
      the appendix from appendices at the given time in durations
    • update

      public float update(float delta)
      updates time and index
      Parameters:
      delta - the amount to add to time
      Returns:
      the updated index
    • appendixAt

      public CharSequence appendixAt(float time)
      Returns:
      the appendix at the given time
    • append

      public CharSequence append(CharSequence seq)
      Returns:
      a CharSequence representing the given seq with the value of appendices at index appended
    • append

      public CharSequence append(CharSequence seq, float time)
      Returns:
      a CharSequence representing the given seq with the appendix at time appended
    • updateAndAppend

      public CharSequence updateAndAppend(CharSequence seq, float delta)
      See Also:
    • set

      public void set(CharSequence[] appendices, float[] durations)
      appendices and durations must be of the same length
      Parameters:
      appendices - the appendices to set
      durations - the durations to set
    • set

      public void set(CharSequence[] appendices, float durations)
      sets the same duration for each appendix
    • getAppendices

      public CharSequence[] getAppendices()
      Returns:
      the appendices
    • setAppendices

      public void setAppendices(CharSequence[] appendices)
      Parameters:
      appendices - the appendices to set
    • getDurations

      public float[] getDurations()
      Returns:
      the durations
    • setDurations

      public void setDurations(float[] durations)
      Parameters:
      durations - the durations to set
    • getTime

      public float getTime()
      Returns:
      the time
    • setTime

      public void setTime(float time)
      Parameters:
      time - the time to set
    • getIndex

      public int getIndex()
      Returns:
      the index
    • setIndex

      public void setIndex(int index)
      Parameters:
      index - the index to set