- java.lang.Object
-
- org.ojalgo.concurrent.MultiviewSet<T>
-
public final class MultiviewSet<T> extends java.lang.ObjectMultiple prioritisedQueue:s backed by a commonSet. Typical usage:- Create a
MultiviewSetinstance - Call
newView(Comparator)(multiple times) to create the necessary views add(Object), orMultiviewSet.PrioritisedView.offer(Object)to any of the views, will have the same effect.MultiviewSet.PrioritisedView.poll()from each of the views as needed.
- Create a
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMultiviewSet.PrioritisedView
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<T>myCommonSetprivate java.util.Collection<MultiviewSet.PrioritisedView>myViews
-
Constructor Summary
Constructors Constructor Description MultiviewSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T entry)Add an entry to the commonSetand allQueue:s.voidclear()booleanisAnyContents()booleanisEmpty()MultiviewSet.PrioritisedViewnewView(java.util.Comparator<? super T> comparator)booleanremove(T entry)Remove an entry from the commonSet.intsize()
-
-
-
Field Detail
-
myCommonSet
private final java.util.Set<T> myCommonSet
-
myViews
private final java.util.Collection<MultiviewSet.PrioritisedView> myViews
-
-
Method Detail
-
add
public boolean add(T entry)
Add an entry to the commonSetand allQueue:s.
-
clear
public void clear()
-
isAnyContents
public boolean isAnyContents()
- Returns:
- true if the main set or any of the priority queues have any contents
-
isEmpty
public boolean isEmpty()
-
newView
public MultiviewSet.PrioritisedView newView(java.util.Comparator<? super T> comparator)
-
remove
public boolean remove(T entry)
Remove an entry from the commonSet. Entries already present in view queues are considered stale and will be skipped duringMultiviewSet.PrioritisedView.poll().
-
size
public int size()
-
-