|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<ChatMessage>
com.threerings.crowd.chat.client.HistoryList
public class HistoryList
Stores chat history.
| Nested Class Summary | |
|---|---|
protected static class |
HistoryList.HistoryUpdatedOp
|
static interface |
HistoryList.Observer
An interface for chat history observers. |
| Field Summary | |
|---|---|
protected HistoryList.HistoryUpdatedOp |
_historyUpdatedOp
An operation used to notify observers of history updates. |
protected ObserverList<HistoryList.Observer> |
_obs
A list of HistoryList.Observers interested in history changes. |
protected static int |
MAX_HISTORY
The maximum number of history entries we'll keep. |
protected static int |
PRUNE_HISTORY
The number of history entries we'll prune when we hit the max. |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
HistoryList()
|
|
| Method Summary | |
|---|---|
void |
addObserver(HistoryList.Observer obs)
Adds an HistoryList.Observer that wants to know about changes to the history. |
void |
clear()
Called to clear the chat display. |
boolean |
displayMessage(ChatMessage msg,
boolean alreadyDisplayed)
Called to display a chat message. |
protected void |
notify(int adjustment)
Notifies listening HistoryList.Observers that there has been a change to this history. |
void |
removeObserver(HistoryList.Observer obs)
Removes a HistoryList.Observer from hearing about changes to the history. |
| Methods inherited from class java.util.ArrayList |
|---|
add, add, addAll, addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| Field Detail |
|---|
protected ObserverList<HistoryList.Observer> _obs
HistoryList.Observers interested in history changes.
protected HistoryList.HistoryUpdatedOp _historyUpdatedOp
protected static final int MAX_HISTORY
protected static final int PRUNE_HISTORY
| Constructor Detail |
|---|
public HistoryList()
| Method Detail |
|---|
public boolean displayMessage(ChatMessage msg,
boolean alreadyDisplayed)
ChatDisplay
displayMessage in interface ChatDisplayalreadyDisplayed - true if a previous chat display in the list has
already displayed this message, false otherwise.
public void clear()
ChatDisplay
clear in interface ChatDisplayclear in interface Collection<ChatMessage>clear in interface List<ChatMessage>clear in class ArrayList<ChatMessage>public void addObserver(HistoryList.Observer obs)
HistoryList.Observer that wants to know about changes to the history.
public void removeObserver(HistoryList.Observer obs)
HistoryList.Observer from hearing about changes to the history.
protected void notify(int adjustment)
HistoryList.Observers that there has been a change to this history.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||