Class ListSupport

java.lang.Object
ch.tocco.nice2.toolbox.api.lang.ListSupport

@Deprecated public class ListSupport extends Object
Deprecated.
Utility for knowing if you're in the first round of a loop. Alternative for using a stupid boolean.

Example usage with a list's toString method: ListSupport listSupport = new ListSupport(); for ( String chunk : myList ) { if (listSupport.separate()) bufer.append(","); buffer.append( chunk ); }

  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated.
    Just asks if the first loop was done, does not change state.
    void
    Deprecated.
    Obvious.
    boolean
    Deprecated.
    Tells if the first loop was done, and sets it to done if it wasn't yet.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ListSupport

      public ListSupport()
      Deprecated.
  • Method Details

    • separate

      public boolean separate()
      Deprecated.
      Tells if the first loop was done, and sets it to done if it wasn't yet.
      Returns:
      true if the first round was done before, changes state.
    • checkFirst

      public boolean checkFirst()
      Deprecated.
      Just asks if the first loop was done, does not change state.
      Returns:
      true if the first round was done before, keeps state.
    • reset

      public void reset()
      Deprecated.
      Obvious.