Class com.tdac.mail.Response
All Packages Class Hierarchy This Package Previous Next Index
Class com.tdac.mail.Response
java.lang.Object
|
+----java.util.Vector
|
+----com.tdac.mail.Response
- public class Response
- extends Vector
This class is used to contain multi-line server responses
- Version:
- 1.0, 11/11/96
- Author:
- Timothy D. A. Cox
-
CRLF
- string form of CRLF
-
Response(int)
- Construct a new response
-
firstLineContains(String)
- Search the first line in this response for a string
-
lastLineContains(String)
- Search the last line in this response for a string
-
lineContains(String, int)
- Search a particular line in this reponse for a string
-
parseBeginString(String)
- Searchs for a string at the beginning of a line
(eg From: name searching for 'From: ' returns name)
-
parseNumber(String)
- Serach this reponse for a string.
-
parseString(String)
- Search this response for a string, returns remaining chars.
-
strip()
- strips the first and last lines
-
toTextArea(TextArea)
- places self into a TextArea
CRLF
public final static String CRLF
- string form of CRLF
Response
public Response(int n)
- Construct a new response
- Parameters:
- n - number of lines to pre-allocate
lineContains
public int lineContains(String str,
int line)
- Search a particular line in this reponse for a string
- Parameters:
- str - the string to be searched for
- line - the reponse line to search
- Returns:
- the index if this vector contains a string
on the 'line' line.
lastLineContains
public int lastLineContains(String str)
- Search the last line in this response for a string
- Parameters:
- str - the string to be searched for
- line - the reponse line to search
- Returns:
- the index if this vector contains a string
on the 'line' line.
firstLineContains
public int firstLineContains(String str)
- Search the first line in this response for a string
- Parameters:
- str - the string to be searched for
- line - the reponse line to search
- Returns:
- the index if this vector contains a string
on the 'line' line.
parseNumber
public int parseNumber(String str)
- Serach this reponse for a string. When found, return
the integer number on the same line. (eg. 2 EXISTS will
return a 2)
- Parameters:
- str - string to look for
- Returns:
- the number or -1 if not found
parseString
public String parseString(String str)
- Search this response for a string, returns remaining chars.
(eg HELLO WORLD searching for HELLO returns WORLD)
- Parameters:
- str - string to search for
- Returns:
- remaining chars on the line or null if not found.
parseBeginString
public String parseBeginString(String str)
- Searchs for a string at the beginning of a line
(eg From: name searching for 'From: ' returns name)
- Parameters:
- str - string to search for
- Returns:
- remaining chars
toTextArea
public String toTextArea(TextArea ta)
- places self into a TextArea
strip
public void strip()
- strips the first and last lines
All Packages Class Hierarchy This Package Previous Next Index