org.jdtaus.core.text
Class Messages

java.lang.Object
  extended by org.jdtaus.core.text.Messages
All Implemented Interfaces:
Serializable, Cloneable

public class Messages
extends Object
implements Cloneable, Serializable

Collection of messages.

Version:
$Id: Messages.java 8044 2009-07-02 01:29:05Z schulte2005 $
Author:
Christian Schulte
See Also:
Serialized Form

Constructor Summary
Messages()
           
 
Method Summary
 void addMessage(Message message)
          Adds a message to the collection.
 void addMessages(Message[] messages)
          Adds an array of messages to the collection.
 void addMessages(Messages messages)
          Adds messages to the collection.
 void clear()
          Removes all messages from the collection.
 Object clone()
          Creates and returns a deep copy of this object.
 Message getMessage(int index)
          Accessor to an indexed message.
 Message[] getMessages()
          Getter for property messages.
 Messages getMessages(Class type)
          Accessor to messages of a given type.
 void removeMessage(Message message)
          Removes a message from the collection.
 Messages removeMessages(Class type)
          Removes messages of a given type.
 void removeMessages(Messages messages)
          Removes messages from the collection.
 int size()
          Getter for property size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Messages

public Messages()
Method Detail

addMessage

public void addMessage(Message message)
Adds a message to the collection.

Parameters:
message - the message to add to the collection.
Throws:
NullPointerException - if message is null.

addMessages

public final void addMessages(Message[] messages)
Adds an array of messages to the collection.

Parameters:
messages - array of messages to add to the collection.
Throws:
NullPointerException - if messages is null or contains null elements.

addMessages

public final void addMessages(Messages messages)
Adds messages to the collection.

Parameters:
messages - collection of messages to add to the collection.
Throws:
NullPointerException - if messages is null.

clear

public void clear()
Removes all messages from the collection.


clone

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

Overrides:
clone in class Object
Returns:
a clone of this instance.

getMessage

public final Message getMessage(int index)
Accessor to an indexed message.

Parameters:
index - the index of the message to return.
Returns:
a reference to the message at index.
Throws:
IndexOutOfBoundsException - if index is negativ, greater than or equal to size().

getMessages

public Message[] getMessages()
Getter for property messages.

Returns:
messages held by the collection.

getMessages

public final Messages getMessages(Class type)
Accessor to messages of a given type.

Parameters:
type - the type of the messages to return.
Returns:
a collection of messages of type type.
Throws:
NullPointerException - if type is null.

removeMessage

public void removeMessage(Message message)
Removes a message from the collection.

Parameters:
message - the message to remove from the collection.
Throws:
NullPointerException - if message is null.

removeMessages

public final Messages removeMessages(Class type)
Removes messages of a given type.

Parameters:
type - the type of the messages to remove.
Returns:
the collection of messages of type type removed from the collection.
Throws:
NullPointerException - if type is null.

removeMessages

public final void removeMessages(Messages messages)
Removes messages from the collection.

Parameters:
messages - collection of messages to remove from the collection.
Throws:
NullPointerException - if messages is null.

size

public final int size()
Getter for property size.

Returns:
the number of elements in this collection.


Copyright © 2005-2009 jDTAUS. All Rights Reserved.