Package gnu.text
Class Char
- java.lang.Object
-
- gnu.text.Char
-
- All Implemented Interfaces:
Externalizable
,Serializable
,Comparable
public class Char extends Object implements Comparable, Externalizable
A wrapper for characters. #author Per Bothner- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
IGNORABLE_CHAR
-
Constructor Summary
Constructors Constructor Description Char()
Should only be used for serialization.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addNamedChars(Map<String,String> map)
static void
append(int i, Appendable out)
static char
castToChar(Object obj)
static int
castToCharacter(Object obj)
static int
castToCharacterOrEof(Object obj)
char
charValue()
static int
checkCharOrEof(Object obj)
Return character value of argument; otherwise return -2.int
compareTo(Object o)
boolean
equals(Object obj)
int
hashCode()
int
intValue()
static boolean
isChar(Object obj)
static boolean
isCharOrEof(Object obj)
static Char
make(int ch)
static Object
makeOrEof(int ch)
static int
nameToChar(String name)
static void
print(int i, Appendable out)
void
print(Consumer out)
void
readExternal(ObjectInput in)
Object
readResolve()
static String
toScmReadableString(int ch)
String
toString()
static String
toString(int value)
static Char
valueOf(int ch)
void
writeExternal(ObjectOutput out)
-
-
-
Field Detail
-
IGNORABLE_CHAR
public static final int IGNORABLE_CHAR
- See Also:
- Constant Field Values
-
-
Method Detail
-
print
public void print(Consumer out)
-
castToChar
public static char castToChar(Object obj)
-
castToCharacter
public static int castToCharacter(Object obj)
-
castToCharacterOrEof
public static int castToCharacterOrEof(Object obj)
-
isChar
public static boolean isChar(Object obj)
-
isCharOrEof
public static boolean isCharOrEof(Object obj)
-
checkCharOrEof
public static int checkCharOrEof(Object obj)
Return character value of argument; otherwise return -2. Uses same conversion ascastToCharacterOrEof
.
-
print
public static void print(int i, Appendable out)
-
append
public static void append(int i, Appendable out) throws IOException
- Throws:
IOException
-
charValue
public final char charValue()
-
intValue
public final int intValue()
-
valueOf
public static Char valueOf(int ch)
-
make
public static Char make(int ch)
-
makeOrEof
public static Object makeOrEof(int ch)
-
nameToChar
public static int nameToChar(String name)
-
toString
public static String toString(int value)
-
toScmReadableString
public static String toScmReadableString(int ch)
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
readResolve
public Object readResolve() throws ObjectStreamException
- Throws:
ObjectStreamException
-
compareTo
public int compareTo(Object o)
- Specified by:
compareTo
in interfaceComparable
-
-