|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.odell.glazedlists.event.ListEventAssembler
public final class ListEventAssembler
Models a continuous stream of changes on a list. Changes of the same type that occur on a continuous set of rows are grouped into blocks automatically for performance benefits.
Atomic sets of changes may involve many lines of changes and many blocks of changes. They are committed to the queue in one action. No other threads should be creating a change on the same list change queue when an atomic change is being created.
| Constructor Summary | |
|---|---|
ListEventAssembler(EventList sourceList,
ListEventPublisher publisher)
Creates a new ListEventAssembler that tracks changes for the specified list. |
|
| Method Summary | |
|---|---|
void |
addChange(int type,
int index)
Convenience method for appending a single change of the specified type. |
void |
addChange(int type,
int startIndex,
int endIndex)
Adds a block of changes to the set of list changes. |
void |
addDelete(int index)
Convenience method for appending a single delete. |
void |
addDelete(int startIndex,
int endIndex)
Convenience method for appending a range of deletes. |
void |
addInsert(int index)
Convenience method for appending a single insert. |
void |
addInsert(int startIndex,
int endIndex)
Convenience method for appending a range of inserts. |
void |
addListEventListener(ListEventListener listChangeListener)
Registers the specified listener to be notified whenever new changes are appended to this list change sequence. |
void |
addUpdate(int index)
Convenience method for appending a single update. |
void |
addUpdate(int startIndex,
int endIndex)
Convenience method for appending a range of updates. |
void |
beginEvent()
Starts a new atomic change to this list change queue. |
void |
beginEvent(boolean allowNestedEvents)
Starts a new atomic change to this list change queue. |
void |
commitEvent()
Commits the current atomic change to this list change queue. |
void |
forwardEvent(ListEvent listChanges)
Forwards the event. |
boolean |
isEventEmpty()
Returns true if the current atomic change to this list change queue is empty; false otherwise. |
void |
removeListEventListener(ListEventListener listChangeListener)
Removes the specified listener from receiving notification when new changes are appended to this list change sequence. |
void |
reorder(int[] reorderMap)
Sets the current event as a reordering. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListEventAssembler(EventList sourceList,
ListEventPublisher publisher)
| Method Detail |
|---|
public void beginEvent()
This simple change event does not support change events nested within. To allow other methods to nest change events within a change event, use beginEvent(true).
public void beginEvent(boolean allowNestedEvents)
allowNestedEvents - false to throw an exception
if another call to beginEvent() is made before
the next call to commitEvent(). Nested events allow
multiple method's events to be composed into a single
event.
public void addChange(int type,
int startIndex,
int endIndex)
One or more calls to this method must be prefixed by a call to beginEvent() and followed by a call to commitEvent().
public void addChange(int type,
int index)
public void addInsert(int index)
public void addDelete(int index)
public void addUpdate(int index)
public void addInsert(int startIndex,
int endIndex)
public void addDelete(int startIndex,
int endIndex)
public void addUpdate(int startIndex,
int endIndex)
public void reorder(int[] reorderMap)
public void forwardEvent(ListEvent listChanges)
Note that this method should be preferred to manually forwarding events because it is heavily optimized.
Note that currently this implementation does a best effort to preserve reorderings. This means that a reordering is lost if it is combined with any other ListEvent.
public void commitEvent()
If the current event is nested within a greater event, this will simply change the nesting level so that further changes are applied directly to the parent change.
public boolean isEventEmpty()
public void addListEventListener(ListEventListener listChangeListener)
public void removeListEventListener(ListEventListener listChangeListener)
== identity comparison to find the listener
instead of equals(). This is because multiple Lists may be
listening and therefore equals() may be ambiguous.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||