19
19
* Hold and query a collection of messages.
21
public interface IMessageHolder
22
extends IMessageHandler { // XXX do not extend - mix instead
23
// XXX go to LT EQ GT GE LE rather than simple orGreater
21
public interface IMessageHolder extends IMessageHandler { // XXX do not extend - mix instead
22
// XXX go to LT EQ GT GE LE rather than simple orGreater
24
23
/** value for orGreater parameter */
25
24
public static final boolean ORGREATER = true;
27
26
/** value for orGreater parameter */
28
27
public static final boolean EQUAL = false;
31
* Tell whether this holder has any message of this kind
32
* (optionally or greater).
30
* Tell whether this holder has any message of this kind (optionally or greater).
33
32
* @param kind the IMessage.Kind to check for - accept any if null
34
* @param orGreater if true, also any greater than the target kind
35
* as determined by IMessage.Kind.COMPARATOR
36
* @return true if this holder has any message of this kind,
37
* or if orGreater and any message has a greater kind,
38
* as determined by IMessage.Kind.COMPARATOR
33
* @param orGreater if true, also any greater than the target kind as determined by IMessage.Kind.COMPARATOR
34
* @return true if this holder has any message of this kind, or if orGreater and any message has a greater kind, as determined
35
* by IMessage.Kind.COMPARATOR
40
37
boolean hasAnyMessage(IMessage.Kind kind, boolean orGreater);
43
* Count the messages currently held by this holder.
44
* Pass null to get all kinds.
40
* Count the messages currently held by this holder. Pass null to get all kinds.
45
42
* @param kind the IMessage.Kind expected, or null for all messages
46
* @param orGreater if true, also any greater than the target kind
47
* as determined by IMessage.Kind.COMPARATOR
43
* @param orGreater if true, also any greater than the target kind as determined by IMessage.Kind.COMPARATOR
48
44
* @return number of IMessage held (now) by this holder
50
46
int numMessages(IMessage.Kind kind, boolean orGreater);
53
* Get all messages or those of a specific kind.
54
* Pass null to get all kinds.
49
* Get all messages or those of a specific kind. Pass null to get all kinds.
55
51
* @param kind the IMessage.Kind expected, or null for all messages
56
* @param orGreater if true, also get any greater than the target kind
57
* as determined by IMessage.Kind.COMPARATOR
52
* @param orGreater if true, also get any greater than the target kind as determined by IMessage.Kind.COMPARATOR
58
53
* @return IMessage[] of messages of the right kind, or IMessage.NONE
60
55
IMessage[] getMessages(IMessage.Kind kind, boolean orGreater);
62
/** @return unmodifiable List view of underlying collection of IMessage */
63
List getUnmodifiableListView();
67
* @throws UnsupportedOperationException if message list is read-only
69
void clearMessages() throws UnsupportedOperationException;
57
/** @return unmodifiable List view of underlying collection of IMessage */
58
List<IMessage> getUnmodifiableListView();
63
* @throws UnsupportedOperationException if message list is read-only
65
void clearMessages() throws UnsupportedOperationException;