org.jdtaus.core.text
Class Message

java.lang.Object
  extended byorg.jdtaus.core.text.Message
All Implemented Interfaces:
Cloneable, Serializable

public abstract class Message
extends Object
implements Cloneable, Serializable

Application message.

Application messages consist of at least the two properties and . The property will be initialized during instantiation to hold the timestamp of instance creation. Property holds the arguments to use for formatting message text. It is recommended that subclasses of this class are declared so that calling on a message instance always returns a type uniquely identifying a message type in the system.

Version:
$Id: Message.java 2201 2007-03-21 23:59:00Z schulte2005 $
Author:
Christian Schulte
See Also:
MessageEventSource, Serialized Form

Field Summary
static Comparator ASCENDING
          Comparator for sorting messsages in ascending order of occurence.
static Comparator DESCENDING
          Comparator for sorting messsages in descending order of occurence.
 
Constructor Summary
Message()
          Creates a new instance.
 
Method Summary
 Object clone()
          Creates and returns a copy of this object.
 boolean equals(Object o)
          Indicates whether some other object is equal to this one.
abstract  Object[] getFormatArguments(Locale locale)
          Getter for property .
abstract  String getText(Locale locale)
          Gets the formatted message text.
 long getTimestamp()
          Getter for property .
 int hashCode()
          Returns a hash code value for this object.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ASCENDING

public static final Comparator ASCENDING
Comparator for sorting messsages in ascending order of occurence.


DESCENDING

public static final Comparator DESCENDING
Comparator for sorting messsages in descending order of occurence.

Constructor Detail

Message

public Message()
Creates a new instance.

Method Detail

clone

public Object clone()
Creates and returns a copy of this object.

Returns:
a clone of this instance.

equals

public final boolean equals(Object o)
Indicates whether some other object is equal to this one.

Messages internally cary a UID which is created during instantiation. This UID is used for comparing with the instance.

Parameters:
o - the reference object with which to compare.
Returns:
if this object is the same as ; otherwise.
See Also:
UID

getFormatArguments

public abstract Object[] getFormatArguments(Locale locale)
Getter for property .

Parameters:
locale - the locale to be used for the arguments to return.
Returns:
the arguments to use when formatting the message text.

getText

public abstract String getText(Locale locale)
Gets the formatted message text.

Parameters:
locale - the locale to be used for the text to return.

getTimestamp

public final long getTimestamp()
Getter for property .

Returns:
the timestamp this message got created.

hashCode

public final int hashCode()
Returns a hash code value for this object.

Returns:
a hash code value for this object.

toString

public String toString()
Returns a string representation of the object.

Returns:
a string representation of the object.


Copyright © 2005-2007 jDTAUS. All Rights Reserved.