Java Utililty Methods Scanner Usage

List of utility methods to do Scanner Usage

Description

The list of methods to do Scanner Usage are organized into topic(s).

Method

voidwaitForStopSignal()
wait For Stop Signal
Scanner in = new Scanner(System.in);
while (!TERM_TOKEN.equals(in.next()))
    ;
Stringwrap(String msg, int wrapWidth, int wrapTolerance)
Attempts to wrap the supplied string with the given width.
if (msg == null)
    throw new IllegalArgumentException("Argument must not be null.");
if (wrapWidth <= 0)
    wrapWidth = 50;
if (wrapTolerance < 0)
    wrapTolerance = 5;
StringBuilder buf = new StringBuilder();
Scanner sc = new Scanner(msg);
...