|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectformatter.Session
public class Session
This is one chat. This is the representation of chat Notifications and Messages
Which make up the time between when a chat window was opened and when one was closed.
For some formats this is one file, for others it is not.
This class doubles as its own factory. It allows only one Session at a time.
To create a new Session, call makeSession(String,String,Date).
Once you're done, call closeSession() before trying to start another session.
At any time, you can call getSession() to access the active Session.
I have decided to call the person that created the log, i.e. the person that saved this log
"me" and the person that is talking with "me", "you". Therefore, getMySN() returns
the name of the creator of this log, and getYourSN() returns the name of the person
talking with "me" -- the other guy.
| Method Summary | |
|---|---|
void |
add(Event e)
Appends the passed Event to the list containted in this
Session. |
void |
append(java.lang.String msg)
Appends the contents of the String object to the end of the last
Message. |
static void |
closeSession()
Closes the current Session, allowing a new one to be made. |
Date |
getDate()
Returns the Date this Session was made. |
java.lang.String |
getMySN()
Returns the SN of the person that saved this log. |
static Session |
getSession()
Gets the most recently created Session. |
java.lang.String |
getYourSN()
Returns the name of the SN talking with "me". |
java.util.Iterator<Event> |
iterator()
Returns an Iterator of all the Events stored in
this Session. |
static Session |
makeSession(java.lang.String mySN,
java.lang.String yourSN,
Date date)
Creates and sets active a new Session. |
static boolean |
sessionIsActive()
Determines if there is a Session already active. |
void |
setDate(Date date)
Sets the date to a new value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Session makeSession(java.lang.String mySN,
java.lang.String yourSN,
Date date)
Session object.
mySN - The name of the SN that is "me".yourSN - The name of the SN that I'm speaking with.date - The date this conversation took place.
Session.public static Session getSession()
Session.
Session.public static void closeSession()
Session, allowing a new one to be made.
public static boolean sessionIsActive()
Session already active.
true if there is an already active Session
false otherwise.public void append(java.lang.String msg)
String object to the end of the last
Message. Assumes the last Event passed to add(Event)
was of type Message. If the last Event was not of
type Message then an exception is thrown.
java.lang.IllegalArgumentException - when the last Event object was
not of type Message.public void add(Event e)
Event to the list containted in this
Session. It is assumed that these Events are
passed chronologically.
e - The Event to add.public java.lang.String getMySN()
public java.lang.String getYourSN()
public Date getDate()
Date this Session was made.
Date this Session was made.public void setDate(Date date)
date - The new Date to change to.
java.lang.IllegalArgumentException - if the passed date occurs before
the date already registered to the session.public java.util.Iterator<Event> iterator()
Iterator of all the Events stored in
this Session.
Events comprising this Session.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||