/** * Creates a {@link ReadOnlyList} to provide a view of an {@link EventList} * that does not allow write operations. */ public ReadOnlyList(EventList<E> source) { super(source); source.addListEventListener(this); }
/** * Create a {@link NetworkList} that brings the specified source online. */ NetworkList(EventList<E> source, ByteCoder byteCoder) { super(source); this.byteCoder = byteCoder; source.addListEventListener(this); }
/** * Creates a {@link ThreadSafeList} that provides thread safe access to all * methods in the source {@link EventList}. */ public ThreadSafeList(EventList<E> source) { super(source); source.addListEventListener(this); }
/** * Creates a {@link ReadOnlyList} to provide a view of an {@link EventList} * that does not allow write operations. */ public ReadOnlyList(EventList<E> source) { super(source); source.addListEventListener(this); }
/** * Constructs a PluggableList which delegates all List methods to the given * <code>source</code>. At some future time, the source EventList may be * replaced using {@link #setSource(EventList)} and this PluggableList will * produce a {@link ListEvent} describing the change in data. * * @param source the source of data to this PluggableList */ public PluggableList(EventList<E> source) { super(source); source.addListEventListener(this); }
/** * Creates a {@link FreezableList} that can freeze the view of the specified * source {@link EventList}. */ public FreezableList(EventList<E> source) { super(source); source.addListEventListener(this); }
/** * Creates a {@link ThreadSafeList} that provides thread safe access to all * methods in the source {@link EventList}. */ public ThreadSafeList(EventList<E> source) { super(source); source.addListEventListener(this); }
/** * Create a {@link TypeSafetyListener} that listens for changes on the * specified source {@link EventList} and verifies the added elements are * one of the allowed types. */ public TypeSafetyListener(EventList<E> source, Set<Class> types) { // reserve a private copy of the supported Classes this.types = types.toArray(new Class[types.size()]); // begin listening to the source list source.addListEventListener(this); }
/** * Creates a {@link SortedList} that sorts the specified {@link EventList} * using the specified {@link Comparator} to determine sort order. If the * specified {@link Comparator} is <code>null</code>, then this {@link List} * will be unsorted. */ public SortedList(EventList<E> source, Comparator<? super E> comparator) { super(source); setComparator(comparator); source.addListEventListener(this); }
/** * @param source the List whose size is reported as the value of this * Calculation */ public Count(EventList source) { super(new Integer(source.size())); this.source = source; this.source.addListEventListener(this); }
/** * Creates a {@link SortedListWithIndexedTree} that sorts the specified {@link EventList} * using the specified {@link java.util.Comparator} to determine sort order. If the * specified {@link java.util.Comparator} is <code>null</code>, then this {@link java.util.List} * will be unsorted. */ public SortedListWithIndexedTree(EventList<E> source, Comparator<? super E> comparator) { super(source); setComparator(comparator); source.addListEventListener(this); }
/** * Creates a {@link AbstractFilterList} that includes a subset of the specified * source {@link EventList}. * * <p>Extending classes must call handleFilterChanged(). */ protected AbstractFilterList(EventList source) { super(new FilterList(source)); // listen for changes to the source list this.source.addListEventListener(this); }
/** * @param source the List whose size is reported as the value of this * Calculation */ public Count(EventList source) { super(new Integer(source.size())); this.source = source; this.source.addListEventListener(this); }
/** * Create a new {@link RangeList} that limits the specified {@link EventList} * to a desired range. */ public RangeList(EventList<E> source) { super(source); currentStartIndex = 0; currentEndIndex = source.size(); source.addListEventListener(this); }
/** * Constructs a SimpleFunctionList that maps the elements of the given source list by the * specified function. * * @param source the source list to transform * @param function the mapping function */ public SimpleFunctionList(EventList<S> source, Function<S, E> function) { super(source); Preconditions.checkNotNull(function, "mapping function is undefined"); this.function = function; source.addListEventListener(this); }
/** * Constructs a SimpleFunctionList that maps the elements of the given source list by the * specified function. * * @param source the source list to transform * @param function the mapping function */ public SimpleFunctionList(EventList<S> source, Function<S, E> function) { super(source); Preconditions.checkNotNull(function, "mapping function is undefined"); this.function = function; source.addListEventListener(this); }
/** * Constructor with session and EventList. * * @param session the session * @param newList the EventList */ public PersistentEventList(SessionImplementor session, EventList newList) { super(session, newList); if (newList == null) throw new IllegalArgumentException("EventList parameter may not be null"); updates = new ListEventAssembler(this, newList.getPublisher()); newList.addListEventListener(this); }
/** * @param source the List whose element at position <code>index</code> is returned * @param index the position of the element in <code>source</code> to be returned * @param defaultValue the value of the calculation if the list does not contain <code>index+1</code> entries */ public ElementAt(EventList<E> source, int index, E defaultValue) { super(source.size() > index ? source.get(index) : defaultValue); this.source = source; this.index = index; this.defaultValue = defaultValue; this.source.addListEventListener(this); }
/** * Private constructor is used as a Java-language hack to allow us to save * a reference to the specified {@link UniqueList}. */ private PopularityList(UniqueList<E> uniqueList) { super(new SortedList<E>(uniqueList, new PopularityComparator<E>(uniqueList))); this.uniqueList = uniqueList; // listen for changes to the source list source.addListEventListener(this); }
/** * Private constructor is used as a Java-language hack to allow us to save * a reference to the specified {@link UniqueList}. */ private PopularityList(UniqueList<E> uniqueList) { super(new SortedList<E>(uniqueList, new PopularityComparator<E>(uniqueList))); this.uniqueList = uniqueList; // listen for changes to the source list source.addListEventListener(this); }