public class Monitor extends Object
Constructor and Description |
---|
Monitor(String sJID,
String sSubject,
String sBody)
Constructor
|
Monitor(String sJID,
String sSubject,
String sBody,
String dtStart,
String dtEnd)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addWatchEvent(WatchEvent oWatch)
add regular expression
|
void |
clearKeywordBody()
clear list of Message Body keywords
|
void |
clearKeywordSubject()
clear list of Message Subject keywords
|
String |
getJID()
get Jabber user ID
|
ArrayList |
getKeywordBody()
get list of keywords in message body
|
ArrayList |
getKeywordSubject()
get list of Message Subject keywords
|
ArrayList |
getWatchEventList()
get list of watch events
|
boolean |
inKeywordBody(String sLine)
determine whether there is a match for list of Message Body keywords
in the specified line
List of words="mine, ship"
Line = "Spotted a mine at location [x,y,z]"
|
boolean |
inKeywordBody(String sJID,
String sLine)
determine whether there is a match for list of Message Body keywords
in the specified line
List of words="mine, ship"
Line = "Spotted a mine at location [x,y,z]"
|
boolean |
inKeywordSubject(String sLine)
determine whether there is a match for list of Message Subject keywords
in the specified line
e.g.
|
boolean |
inKeywordSubject(String sJID,
String sLine)
determine whether there is a match for list of Message Subject keywords
in the specified line
e.g.
|
WatchEvent |
inRegExp(String sLine)
check whether the line matches one of the regular expression
|
void |
setJID(String sJID)
set JID
|
void |
setKeywordBody(ArrayList<String> lst)
pass in list of Message Body keywords
|
void |
setKeywordBody(String sKey)
extract list of Message Body keywords in string delimited by "," and
put in ArrayList
|
void |
setKeywordSubject(ArrayList<String> lst)
pass in list of Message Subject keywords
|
void |
setKeywordSubject(String sKey)
extract list of Subject keywords in string delimited by "," and
put in ArrayLisy
|
String |
toString()
display contents of object
|
static void |
writeErr(String aStr)
write a error messgae to console
|
static void |
writeLn()
write a line to console
|
static void |
writeLn(String aStr)
write a line to console
|
public Monitor(String sJID, String sSubject, String sBody)
sJID
- Jabber User IDsSubject
- Message Subject keywordssBody
- Message Body keywordspublic Monitor(String sJID, String sSubject, String sBody, String dtStart, String dtEnd)
sJID
- Jabber User IDsSubject
- Message Subject keywordssBody
- Message Body keywordsdtStart
- start from, in "yyyymmddhhmmss" formatdtEnd
- stop at, in "yyyymmddhhmmss" formatpublic String getJID()
public void setJID(String sJID)
sJID
- Jabber user IDpublic void addWatchEvent(WatchEvent oWatch)
oWatch
- a Watch Eventpublic ArrayList getWatchEventList()
public void clearKeywordBody()
public ArrayList getKeywordBody()
public boolean inKeywordBody(String sJID, String sLine)
sJID
- Jabber user IDsLine
- sentence to be checkedpublic boolean inKeywordBody(String sLine)
sLine
- sentence to be checkedpublic void setKeywordBody(String sKey)
sKey
- string of keywordspublic void setKeywordBody(ArrayList<String> lst)
lst
- list of keywordspublic void clearKeywordSubject()
public ArrayList getKeywordSubject()
public boolean inKeywordSubject(String sJID, String sLine)
sJID
- Jabber user IDsLine
- sentence to be checkedpublic boolean inKeywordSubject(String sLine)
sLine
- sentence to be checkedpublic WatchEvent inRegExp(String sLine)
sLine
- source string to be matchedpublic void setKeywordSubject(String sKey)
sKey
- string of keywordspublic void setKeywordSubject(ArrayList<String> lst)
lst
- list of keywordspublic String toString()
public static void writeErr(String aStr)
aStr
- line to be written to consolepublic static void writeLn(String aStr)
aStr
- line to be written to consolepublic static void writeLn()