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

Variable Index

 o CRLF
string form of CRLF

Constructor Index

 o Response(int)
Construct a new response

Method Index

 o firstLineContains(String)
Search the first line in this response for a string
 o lastLineContains(String)
Search the last line in this response for a string
 o lineContains(String, int)
Search a particular line in this reponse for a string
 o parseBeginString(String)
Searchs for a string at the beginning of a line (eg From: name searching for 'From: ' returns name)
 o parseNumber(String)
Serach this reponse for a string.
 o parseString(String)
Search this response for a string, returns remaining chars.
 o strip()
strips the first and last lines
 o toTextArea(TextArea)
places self into a TextArea

Variables

 o CRLF
  public final static String CRLF
string form of CRLF

Constructors

 o Response
  public Response(int n)
Construct a new response
Parameters:
n - number of lines to pre-allocate

Methods

 o 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.
 o 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.
 o 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.
 o 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
 o 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.
 o 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
 o toTextArea
  public String toTextArea(TextArea ta)
places self into a TextArea
 o strip
  public void strip()
strips the first and last lines

All Packages  Class Hierarchy  This Package  Previous  Next  Index