ca.odell.glazedlists

Class PopularityList<E>

Implemented Interfaces:
EventListener, EventList<E>, List, ListEventListener<E>

public final class PopularityList<E>
extends TransformedList<S,E>

An EventList that shows the unique elements from its source EventList ordered by the frequency of their appearance.

This EventList supports all write operations.

Warning: This class breaks the contract required by java.util.List. See EventList for an example.

EventList Overview
Writable:yes
Concurrency:thread ready, not thread safe
Performance:reads: O(log N), writes O(log N)
Memory:196 bytes per element
Unit Tests:N/A
Issues: 104
Author:
Jesse Wilson

Field Summary

Fields inherited from class ca.odell.glazedlists.TransformedList<S,E>

source

Fields inherited from class ca.odell.glazedlists.AbstractEventList<E>

publisher, readWriteLock, updates

Constructor Summary

PopularityList(EventList source)
Creates a new PopularityList that provides frequency-ranking for the specified EventList.
PopularityList(EventList source, Comparator uniqueComparator)
Creates a new PopularityList that provides frequency-ranking for the specified EventList.

Method Summary

void
dispose()
protected boolean
isWritable()
void
listChanged(ListEvent listChanges)

Methods inherited from class ca.odell.glazedlists.TransformedList<S,E>

add, addAll, clear, dispose, get, getSourceIndex, isWritable, listChanged, remove, removeAll, retainAll, set, size

Methods inherited from class ca.odell.glazedlists.AbstractEventList<E>

T[] toArray, add, add, addAll, addAll, addListEventListener, clear, contains, containsAll, equals, get, getPublisher, getReadWriteLock, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeListEventListener, retainAll, set, size, subList, toArray, toString

Constructor Details

PopularityList

public PopularityList(EventList source)
Creates a new PopularityList that provides frequency-ranking for the specified EventList.

PopularityList

public PopularityList(EventList source,
                      Comparator uniqueComparator)
Creates a new PopularityList that provides frequency-ranking for the specified EventList.
Parameters:
uniqueComparator - The Comparator used to determine equality.

Method Details

dispose

public void dispose()
Overrides:
dispose in interface TransformedList<S,E>

isWritable

protected boolean isWritable()
Overrides:
isWritable in interface TransformedList<S,E>

listChanged

public void listChanged(ListEvent listChanges)
Specified by:
listChanged in interface ListEventListener<E>

Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by buildd at 2008-01-04 14:38