Class Twiddler

java.lang.Object
com.xinapse.util.Twiddler

public class Twiddler extends Object
Class to show a twiddly rotating line to indicate that some action is being performed in text-mode applications.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Twiddler, writing twiddles to System.out and no initial message.
    Twiddler(String initialMessage)
    Creates a new Twiddler, writing an initial message and the twiddles to System.out.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Indicates that the operation for which this twiddler was created is finished.
    void
    done(String message)
    Indicates that the operation for which this twiddler was created is finished.
    void
    Twiddles the twiddler.

    Methods inherited from class java.lang.Object

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

    • Twiddler

      public Twiddler()
      Creates a new Twiddler, writing twiddles to System.out and no initial message.
    • Twiddler

      public Twiddler(String initialMessage)
      Creates a new Twiddler, writing an initial message and the twiddles to System.out.
      Parameters:
      initialMessage - the initial message to write.
  • Method Details

    • twiddle

      public void twiddle()
      Twiddles the twiddler. You should call this method after every incremental action in you application to indicate progress.
    • done

      public void done()
      Indicates that the operation for which this twiddler was created is finished. Prints the message "done." and moves on to the next line of output.
    • done

      public void done(String message)
      Indicates that the operation for which this twiddler was created is finished. Prints the supplied message, and moves on to the next line of output.
      Parameters:
      message - the message to print.