|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.neu.ccs.XObject
|
+--edu.neu.ccs.XChar
Object wrapper for the primitive
char type that also provides
capabilities.
The default value for this class is
the Stringablechar 0.
| Field Summary |
| Fields inherited from class edu.neu.ccs.XObject |
changeAdapter, VALUE |
| Constructor Summary | |
XChar()
Constructs a wrapper for the default char value. |
|
XChar(char c)
Constructs a wrapper for the given char value. |
|
XChar(String s)
Constructs a wrapper for the char value
whose state information is encapsulated
in the given String data. |
|
| Method Summary | |
boolean |
equals(Object other)
Returns true if the wrapped object
is equal to the given object, and false
if it is not. |
void |
fromStringData(String data)
Sets the state of this object using information contained in the given String. |
char |
getValue()
Returns the value wrapped by this object. |
int |
hashCode()
Returns an int hash code
appropriate for the wrapped object. |
static char |
parseChar(String s)
Parses a char value from a String |
void |
setValue(char c)
Sets the value wrapped by this object to the given value. |
static char[] |
toPrimitiveArray(XChar[] x)
Returns an array of primitive char values
copied from the given array
of XChar objects. |
String |
toString()
Returns a String representation
of the wrapped value. |
String |
toStringData()
Returns a String encapsulation of this object
that contains information needed
to set the state of this object at a later time. |
static XChar[] |
toXArray(char[] a)
Returns an array of XChar objects
initialized from the given array
of char values. |
| Methods inherited from class edu.neu.ccs.XObject |
addPropertyChangeListener, addPropertyChangeListener, formatErrorMessage, removePropertyChangeListener, removePropertyChangeListener, toStringArray |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public XChar()
char value.
XChar(char),
XChar(String)public XChar(char c)
char value.
c - the value to be wrappedXChar(),
XChar(String)
public XChar(String s)
throws ParseException
char value
whose state information is encapsulated
in the given String data.
s - a String representation
of the desired value
ParseException - if the data is malformedXChar(),
XChar(char)| Method Detail |
public void fromStringData(String data)
throws ParseException
StringableString.
fromStringData in interface StringablefromStringData in class XObjectdata - the String containing state information
ParseException - if the data is malformedStringable.toStringData()public String toStringData()
StringableString encapsulation of this object
that contains information needed
to set the state of this object at a later time.
toStringData in interface StringabletoStringData in class XObjectStringable.fromStringData(String)public boolean equals(Object other)
true if the wrapped object
is equal to the given object, and false
if it is not.
equals in class Objectpublic int hashCode()
int hash code
appropriate for the wrapped object.
hashCode in class Objectpublic String toString()
String representation
of the wrapped value.
toString in class Objectpublic void setValue(char c)
c - the value to be wrappedgetValue()public char getValue()
setValue(char)
public static char parseChar(String s)
throws NumberFormatException
char value from a String
using the current shared parser.
- Returns:
- the extracted
char value
- Throws:
NumberFormatException - if the data is malformed
public static char[] toPrimitiveArray(XChar[] x)
char values
copied from the given array
of XChar objects.
x - an array of XChars
char valuestoXArray(char[])public static XChar[] toXArray(char[] a)
XChar objects
initialized from the given array
of char values.
a - an array of chars
XChar objectstoPrimitiveArray(XChar[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||