|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cuny.cat.comm.Message
public abstract class Message
An abstract class representing a plain-text message.
Field Summary | |
---|---|
static java.lang.String |
CRLF
|
static java.lang.String |
VALUE_SEPARATOR
the string separating items in a list. |
Constructor Summary | |
---|---|
Message()
|
Method Summary | |
---|---|
static java.lang.String |
concatenate(double[] numbers)
concatenates the string representations of doubles in an array. |
static java.lang.String |
concatenate(int[] numbers)
concatenates the string representations of integers in an array. |
static java.lang.String |
concatenate(java.lang.String[] texts)
concatenates an array of strings with the default VALUE_SEPARATOR ,
and return its string representation. |
static java.lang.String |
concatenate(java.lang.String[] texts,
java.lang.String separator)
concatenates an array of strings with the separator, and return its string representation. |
static double[] |
parseDoubles(java.lang.String s)
parses a String into a list of doubles. |
static int[] |
parseIntegers(java.lang.String s)
parses a String into a list of integers. |
static java.lang.String[] |
parseStrings(java.lang.String s)
parses a list of plain-text words, separated by VALUE_SEPARATOR . |
abstract java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CRLF
public static java.lang.String VALUE_SEPARATOR
Constructor Detail |
---|
public Message()
Method Detail |
---|
public abstract java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String[] parseStrings(java.lang.String s)
VALUE_SEPARATOR
.
s
- a word list
public static double[] parseDoubles(java.lang.String s) throws MessageException
String
into a list of doubles.
s
- a double list
MessageException
- if an entry in the list fails to be parsed into double.parseStrings(String)
public static int[] parseIntegers(java.lang.String s) throws MessageException
String
into a list of integers.
s
- an integer list
CatException
- if an entry in the list fails to be parsed into integer.
MessageException
parseStrings(String)
public static java.lang.String concatenate(java.lang.String[] texts)
VALUE_SEPARATOR
,
and return its string representation.
concatenate(String[], String)
public static java.lang.String concatenate(java.lang.String[] texts, java.lang.String separator)
texts
- the array of strings.separator
- the string to separate the strings.
String
instance for this representation.public static java.lang.String concatenate(double[] numbers)
numbers
- an array of doubles
String
instance for this representation.concatenate(String[])
public static java.lang.String concatenate(int[] numbers)
numbers
- an array of intergers
String
instance for this representation.concatenate(String[])
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |