public class RxOrderedSet<T> extends ForwardingBox.Rx<ImmutableList<T>>
RxBox
<ImmutableList
<T>>
which promises to exclude duplicates.
We dont' actually want it to be this - we actually want it to be a
stateful wrapper around calls to `set`, but we'll settle for this
for now.Modifier and Type | Class and Description |
---|---|
static class |
RxOrderedSet.OnDuplicate
Policies for disallowing duplicates.
|
ForwardingBox.Cas<T>, ForwardingBox.Lock<T>, ForwardingBox.Rx<T>, ForwardingBox.RxLock<T>
delegate
Modifier | Constructor and Description |
---|---|
protected |
RxOrderedSet(ImmutableList<T> initial,
RxOrderedSet.OnDuplicate duplicatePolicy)
Initally holds the given collection.
|
Modifier and Type | Method and Description |
---|---|
RxOrderedSet.OnDuplicate |
getDuplicatePolicy()
Returns the duplicate policy for this RxList.
|
ImmutableList<T> |
mutate(Consumer<List<T>> mutator)
Mutates this set.
|
static <T> RxOrderedSet<T> |
of(ImmutableList<T> initial)
Creates an RxList with the given initial value.
|
static <T> RxOrderedSet<T> |
of(ImmutableList<T> initial,
RxOrderedSet.OnDuplicate duplicatePolicy)
Creates an RxList with the given initial value.
|
static <T> RxOrderedSet<T> |
ofEmpty()
Creates an RxList with an initially empty value.
|
static <T> RxOrderedSet<T> |
ofEmpty(RxOrderedSet.OnDuplicate duplicatePolicy)
Creates an RxList with an initially empty value.
|
void |
set(ImmutableList<T> newSelection)
Sets the selection.
|
asObservable
get
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
combineLatest, from, fromVolatile, map
subscribe, wrap
accept, from, modify, ofVolatile
protected RxOrderedSet(ImmutableList<T> initial, RxOrderedSet.OnDuplicate duplicatePolicy)
public static <T> RxOrderedSet<T> ofEmpty()
public static <T> RxOrderedSet<T> ofEmpty(RxOrderedSet.OnDuplicate duplicatePolicy)
public static <T> RxOrderedSet<T> of(ImmutableList<T> initial)
public static <T> RxOrderedSet<T> of(ImmutableList<T> initial, RxOrderedSet.OnDuplicate duplicatePolicy)
public RxOrderedSet.OnDuplicate getDuplicatePolicy()
public void set(ImmutableList<T> newSelection)
set
in interface Box<ImmutableList<T>>
set
in class ForwardingBox<ImmutableList<T>,RxBox<ImmutableList<T>>>
public ImmutableList<T> mutate(Consumer<List<T>> mutator)