com.internationalnetwork.tui
Class JScreenCharacter

Object
  extended by com.internationalnetwork.tui.JScreenCharacter

public class JScreenCharacter
extends Object

The JScreenCharacter class encapsulates each character that is displayed on the JScreen object's screen, and keeps track of all its attributes (the character's on-screen position is not included in the list of attributes as this is tracked directly by the JScreen object).


Field Summary
static String VERSION
          Version number of this Package (read-only).
 
Constructor Summary
JScreenCharacter(byte[] character, JScreenFont font, int... args)
          Construct a new JScreenCharacter object with ASCII character defined by element 0 from the specified byte[] array.
JScreenCharacter(byte character, JScreenFont font, int... args)
          Construct a new JScreenCharacter object with ASCII character defined by the specified byte, which will immediately be converted to, and stored as, a single-element byte[] array.
JScreenCharacter(char character, JScreenFont font, int... args)
          Construct a new JScreenCharacter object with the specified char, which will immediately be converted to, and stored as, a single-element byte[] array.
JScreenCharacter(int character, JScreenFont font, int... args)
          Construct a new JScreenCharacter object with ASCII character defined by the specified int, which will immediately be converted to, and stored as, a single-element byte[] array.
JScreenCharacter(short character, JScreenFont font, int... args)
          Construct a new JScreenCharacter object with ASCII character defined by the specified short, which will immediately be converted to, and stored as, a single-element byte[] array.
JScreenCharacter(String character, JScreenFont font, int... args)
          Construct a new JScreenCharacter object with the specified String character (if the String is longer than one character, only the first will be used), which will immediately be converted to, and stored as, a single-element byte[] array.
 
Method Summary
 JScreenCharacter clone()
          Creates a new JScreenCharacter object with a copy of this one's attributes.
 byte get()
          Returns the byte value of this JScreenCharacter's ASCII character.
 int getASCII()
          Returns the integer value of this JScreenCharacter's ASCII character.
 byte getASCIIByte()
          Returns the byte value of this JScreenCharacter's ASCII character.
 JScreenCharacter set(int... args)
          Alters the value of any number of parameters (in any order).
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
Version number of this Package (read-only).

See Also:
Constant Field Values
Constructor Detail

JScreenCharacter

public JScreenCharacter(byte[] character,
                        JScreenFont font,
                        int... args)
Construct a new JScreenCharacter object with ASCII character defined by element 0 from the specified byte[] array.

Parameters:
character - byte containing a character
font - The JScreen font that we're using (the shape information will be copied from this font)
args - Variable list of parameters and their values

JScreenCharacter

public JScreenCharacter(byte character,
                        JScreenFont font,
                        int... args)
Construct a new JScreenCharacter object with ASCII character defined by the specified byte, which will immediately be converted to, and stored as, a single-element byte[] array.

Parameters:
character - byte containing a character
font - The JScreen font that we're using (the shape information will be copied from this font)
args - Variable list of parameters and their values

JScreenCharacter

public JScreenCharacter(char character,
                        JScreenFont font,
                        int... args)
Construct a new JScreenCharacter object with the specified char, which will immediately be converted to, and stored as, a single-element byte[] array.

Parameters:
character - char containing a character
font - The JScreen font that we're using (the shape information will be copied from this font)
args - Variable list of parameters and their values

JScreenCharacter

public JScreenCharacter(int character,
                        JScreenFont font,
                        int... args)
Construct a new JScreenCharacter object with ASCII character defined by the specified int, which will immediately be converted to, and stored as, a single-element byte[] array.

A loss of precision will occur for values below 0 or greater than 255, because only smallest-valued 8 bits will be used.

Parameters:
character - int containing an ASCII value ranging from 0 through 255
font - The JScreen font that we're using (the shape information will be copied from this font)
args - Variable list of parameters and their values

JScreenCharacter

public JScreenCharacter(short character,
                        JScreenFont font,
                        int... args)
Construct a new JScreenCharacter object with ASCII character defined by the specified short, which will immediately be converted to, and stored as, a single-element byte[] array.

A loss of precision will occur for values below 0 or greater than 255, because only smallest-valued 8 bits will be used.

Parameters:
character - int containing an ASCII value ranging from 0 through 255
font - The JScreen font that we're using (the shape information will be copied from this font)
args - Variable list of parameters and their values

JScreenCharacter

public JScreenCharacter(String character,
                        JScreenFont font,
                        int... args)
Construct a new JScreenCharacter object with the specified String character (if the String is longer than one character, only the first will be used), which will immediately be converted to, and stored as, a single-element byte[] array.

Parameters:
character - String containing a character
font - The JScreen font that we're using (the shape information will be copied from this font)
args - Variable list of parameters and their values
Method Detail

clone

public JScreenCharacter clone()
Creates a new JScreenCharacter object with a copy of this one's attributes.

Overrides:
clone in class Object

get

public byte get()
Returns the byte value of this JScreenCharacter's ASCII character.

Returns:
Signed ASCII character number (in the range of -128 through 127)

getASCII

public int getASCII()
Returns the integer value of this JScreenCharacter's ASCII character.

Returns:
Unsigned ASCII character number (in the range of 0 through 255)

getASCIIByte

public byte getASCIIByte()
Returns the byte value of this JScreenCharacter's ASCII character.

Returns:
Signed ASCII character number (in the range of -128 through 127)

set

public JScreenCharacter set(int... args)
Alters the value of any number of parameters (in any order).

Parameters:
args - Variable list of parameters and their values
Returns:
Reference to this object so that the programmer can stack this set() method before other methods, to help make code easier to read.