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 new Appender with the same duration for each appendix
    Appender​(java.lang.CharSequence[] appendices, float[] durations)  
    Appender​(java.lang.CharSequence appendices, float durations)
    instantiates a new Appender with both appendices and durations 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 from appendices at the given time in durations
    java.lang.CharSequence[] getAppendices()  
    float[] getDurations()  
    int getIndex()  
    float getTime()  
    void set​(java.lang.CharSequence[] appendices, float durations)
    sets the same duration for each appendix
    void set​(java.lang.CharSequence[] appendices, float[] durations)
    appendices and durations must be of the same length
    void setAppendices​(java.lang.CharSequence[] appendices)  
    void setDurations​(float[] durations)  
    void setIndex​(int index)  
    void setTime​(float time)  
    float update​(float delta)
    updates time and index
    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 new Appender with both appendices and durations being 1 in length with the given value
    • Appender

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

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

    • append

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

      public static java.lang.CharSequence appendixAt​(float time, java.lang.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 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 given seq with the value of appendices at index appended
    • append

      public java.lang.CharSequence append​(java.lang.CharSequence seq, float time)
      Returns:
      a CharSequence representing the given seq with the appendix 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 and durations must be of the same length
      Parameters:
      appendices - the appendices to set
      durations - the durations to set
    • set

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

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

      public void setAppendices​(java.lang.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