com.xinapse.util
Class Twiddler

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

public class Twiddler
extends java.lang.Object

Class to show a twiddly rotating line to indicate that some action is being performed in text-mode applications.


Constructor Summary
Twiddler()
          Creates a new Twiddler, writing twiddles to System.out.
Twiddler(java.io.PrintStream s)
          Creates a new Twiddler, writing twiddles the specified PrintStream.
 
Method Summary
 void done()
          Indicates that the operation for which this twiddler was created is finished.
 void done(java.lang.String message)
          Indicates that the operation for which this twiddler was created is finished.
 void twiddle()
          Twiddles the twiddler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Twiddler

public Twiddler()
Creates a new Twiddler, writing twiddles to System.out.


Twiddler

public Twiddler(java.io.PrintStream s)
Creates a new Twiddler, writing twiddles the specified PrintStream.

Parameters:
s - the PrintStream to which twiddles will be written.
Method Detail

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(java.lang.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.


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.