braju.com
Java printf & scanf (beta)

com.braju.beta.lang
Class BooleanVariable

java.lang.Object
  |
  +--com.braju.beta.lang.BooleanVariable
All Implemented Interfaces:
Variable

public final class BooleanVariable
extends java.lang.Object
implements Variable

Wraps a boolean and provides methods to convert the value to and from several datatypes [JDK1.0.2 compatible].


Field Summary
static int ALIGN_CENTER
          When converting a boolean to a string with specified minimum width, this constant says that the result should be aligned to the center.
static int ALIGN_LEFT
          When converting a boolean to a string with specified minimum width, this constant says that the result should be aligned to the left.
static int ALIGN_RIGHT
          When converting a boolean to a string with specified minimum width, this constant says that the result should be aligned to the right.
static int NO_FLAGS
          When converting a boolean to a string with specified minimum width, this constant says that the default format should be used [...].
static java.lang.Class TYPE
          The class of this static object [...].
 
Constructor Summary
BooleanVariable()
           
BooleanVariable(boolean b)
          Wraps a boolean into an object just like java.lang.Boolean does, but provides some additional methods.
 
Method Summary
 java.lang.Object get()
           
static void main(java.lang.String[] args)
           
static BooleanVariable[] newArray(int length)
          Creates an array of length instance of this class.
 void set(boolean b)
          Set a new value [...].
 void set(java.lang.Object o)
           
static java.lang.String toChoiseString(boolean b, java.lang.String True, java.lang.String False)
          Convert a boolean into a string with the specifed true- and false-strings [...].
static java.lang.String toChoiseString(boolean b, java.lang.String True, java.lang.String False, int minWidth, int flags)
          Convert a boolean into a string with the specifed true- and false-strings and minimum width and alignment.
static java.lang.String toString(boolean b)
          Convert a boolean into a string.
static java.lang.String toString(boolean b, int minWidth, int flags)
          Convert a boolean into a string with specified minimum width and alignment according to the flags-parameter [...].
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_FLAGS

public static final int NO_FLAGS
When converting a boolean to a string with specified minimum width, this constant says that the default format should be used [...]. See also ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT.

ALIGN_LEFT

public static final int ALIGN_LEFT
When converting a boolean to a string with specified minimum width, this constant says that the result should be aligned to the left.

ALIGN_CENTER

public static final int ALIGN_CENTER
When converting a boolean to a string with specified minimum width, this constant says that the result should be aligned to the center.

ALIGN_RIGHT

public static final int ALIGN_RIGHT
When converting a boolean to a string with specified minimum width, this constant says that the result should be aligned to the right.

TYPE

public static final java.lang.Class TYPE
The class of this static object [...]. Provides a convenient way to check or compare the type.
Constructor Detail

BooleanVariable

public BooleanVariable()

BooleanVariable

public BooleanVariable(boolean b)
Wraps a boolean into an object just like java.lang.Boolean does, but provides some additional methods.
Method Detail

newArray

public static BooleanVariable[] newArray(int length)
Creates an array of length instance of this class.

set

public void set(boolean b)
Set a new value [...]. This is better than creating a new object all the time.

set

public void set(java.lang.Object o)
Specified by:
set in interface Variable

get

public java.lang.Object get()
Specified by:
get in interface Variable

toString

public static java.lang.String toString(boolean b)
Convert a boolean into a string.

toString

public static java.lang.String toString(boolean b,
                                        int minWidth,
                                        int flags)
Convert a boolean into a string with specified minimum width and alignment according to the flags-parameter [...]. Provides an easy way to align a boolean to the left, the right och to the center. If flags is given the value NO_FLAGS then the result is aligned to the left.

toChoiseString

public static java.lang.String toChoiseString(boolean b,
                                              java.lang.String True,
                                              java.lang.String False)
Convert a boolean into a string with the specifed true- and false-strings [...]. For instance, you can convert a boolean into an "yes" or "no" result. There is no limitations of what is outputted instead of the "true"/"false" results.

toChoiseString

public static java.lang.String toChoiseString(boolean b,
                                              java.lang.String True,
                                              java.lang.String False,
                                              int minWidth,
                                              int flags)
Convert a boolean into a string with the specifed true- and false-strings and minimum width and alignment.

main

public static void main(java.lang.String[] args)

braju.com
Java printf & scanf (beta)

Copyright 1997-2000, Henrik Bengtsson.