|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.hagenah.diplomacy.game.Message
public class Message
A message in a game.
| Field Summary | |
|---|---|
static int |
TOSTRING_BODY
Returns the message body |
static int |
TOSTRING_CSS
The CSS class color-? |
static int |
TOSTRING_DATE
Returns the message date, e.g. |
static int |
TOSTRING_HTML
Returns a xhtml text, e.g. → instead of -> |
static int |
TOSTRING_SHORT
Returns a short text, e.g. |
| Constructor Summary | |
|---|---|
Message(boolean anonymous,
Person from,
boolean toallbut,
java.util.Collection to,
boolean faketoallbut,
java.util.Collection faketo,
java.lang.String text,
java.util.Date messagedate,
int lastturnnumber,
int messagenumber)
Creates a new message. |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object obj)
Compares two messages by message number. |
boolean |
equals(java.lang.Object obj)
Indicates whether obj is "equal to" this one. |
java.util.SortedSet |
getFakeTo()
Return the fake to person set. |
Person |
getFrom()
Returns the person that sent the message (can be null if unknown). |
int |
getLastTurnNumber()
Return the number of the last turn, when the message was created |
java.util.Date |
getMessageDate()
Returns the date of the message (can be null). |
int |
getMessageNumber()
Returns the number of the message |
java.lang.String |
getMessageText()
Returns the message text (\n as line separator) |
java.util.SortedSet |
getTo()
Return the to person set. |
int |
hashCode()
Returns a hashcode for this message. |
boolean |
isAnonymous()
Is the message anonymous (grey)? |
boolean |
isBroadcast()
Is the message a broadcast message? |
boolean |
isFake()
Is the message a fake? |
boolean |
isFakeBroadcast()
Is the message a fake broadcast message? |
boolean |
isFakeToAllBut()
Return whether FakeTo must be interpreted as fake to or as fake to all but. |
boolean |
isToAllBut()
Return whether To must be interpreted as to or as to all but. |
boolean |
isVisible(Person person)
Is this message visible to the specified person? |
java.lang.String |
toString()
Returns a short description for the message |
java.lang.String |
toString(int flags,
java.util.Locale locale)
Return a text for the message (e.g. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TOSTRING_BODY
public static final int TOSTRING_SHORT
public static final int TOSTRING_DATE
public static final int TOSTRING_HTML
public static final int TOSTRING_CSS
| Constructor Detail |
|---|
public Message(boolean anonymous,
Person from,
boolean toallbut,
java.util.Collection to,
boolean faketoallbut,
java.util.Collection faketo,
java.lang.String text,
java.util.Date messagedate,
int lastturnnumber,
int messagenumber)
anonymous - Is the message anonymous (grey)?from - The person that sent the message (can be null if unknown)toallbut - false → the message was sent to to, true → the message was
send to all but to (if to is empty it was a broadcast message).to - The interpretation depends on toallbut (can be null if unknown)faketoallbut - false → the message was faked to faketo, true → the message was
faked to all but faketo (if faketo is empty it was a faked broadcast message).faketo - The interpretation depends on faketoallbut (cannot be null)text - The message text (\n as line separator)messagedate - The date of the message (can be null)lastturnnumber - The number of the last turn, when the message was createdmessagenumber - The number of the message| Method Detail |
|---|
public boolean isAnonymous()
public Person getFrom()
public boolean isToAllBut()
public boolean isBroadcast()
public java.util.SortedSet getTo()
public boolean isFakeToAllBut()
public boolean isFakeBroadcast()
public boolean isFake()
public java.util.SortedSet getFakeTo()
public java.lang.String getMessageText()
public java.util.Date getMessageDate()
public int getLastTurnNumber()
public int getMessageNumber()
public boolean isVisible(Person person)
person - The person
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - The other obj
public int compareTo(java.lang.Object obj)
compareTo in interface java.lang.Comparableobj - The other obj
public int hashCode()
hashCode in class java.lang.Object
public java.lang.String toString(int flags,
java.util.Locale locale)
flags - TOSTRING_BODY, TOSTRING_SHORT, TOSTRING_DATE, TOSTRING_HTML, TOSTRING_CSSlocale - The locale for the DateFormat. The default locale is used if
null is specified.
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||