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 intIGNORABLE_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 voidaddNamedChars(Map<String,String> map)static voidappend(int i, Appendable out)static charcastToChar(Object obj)static intcastToCharacter(Object obj)static intcastToCharacterOrEof(Object obj)charcharValue()static intcheckCharOrEof(Object obj)Return character value of argument; otherwise return -2.intcompareTo(Object o)booleanequals(Object obj)inthashCode()intintValue()static booleanisChar(Object obj)static booleanisCharOrEof(Object obj)static Charmake(int ch)static ObjectmakeOrEof(int ch)static intnameToChar(String name)static voidprint(int i, Appendable out)voidprint(Consumer out)voidreadExternal(ObjectInput in)ObjectreadResolve()static StringtoScmReadableString(int ch)StringtoString()static StringtoString(int value)static CharvalueOf(int ch)voidwriteExternal(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:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
readResolve
public Object readResolve() throws ObjectStreamException
- Throws:
ObjectStreamException
-
compareTo
public int compareTo(Object o)
- Specified by:
compareToin interfaceComparable
-
-