Selection
public
class
Selection
extends Object
implements
Iterable<K>
java.lang.Object
|
↳ |
androidx.recyclerview.selection.Selection<K>
|
Object representing a "primary" selection and a "provisional" selection.
This class tracks selected items by managing two sets:
Primary Selection
Primary selection consists of items selected by a user. This represents the selection
"at rest", as the selection does not contains items that are in a "provisional" selected
state created by way of an ongoing gesture or band operation.
Provisional Selection
Provisional selections are selections which are interim in nature.
Provisional selection exists to address issues where a transitory selection might
momentarily intersect with a previously established selection resulting in a some
or all of the established selection being erased. Such situations may arise
when band selection is being performed in "additive" mode (e.g. SHIFT or CTRL is pressed
on the keyboard prior to mouse down), or when there's an active gesture selection
(which can be initiated by long pressing an unselected item while there is an
existing selection).
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
java.lang.Iterable
default
void
|
forEach(Consumer<? super T> arg0)
|
abstract
Iterator<K>
|
iterator()
|
default
Spliterator<K>
|
spliterator()
|
|
Public methods
contains
public boolean contains (K key)
Returns |
boolean |
true if the position is currently selected.
|
equals
public boolean equals (Object other)
hashCode
public int hashCode ()
isEmpty
public boolean isEmpty ()
Returns |
boolean |
true if the selection is empty.
|
iterator
public Iterator<K> iterator ()
Returns an Iterator
that iterators over the selection, *excluding*
any provisional selection.
size
public int size ()
Returns |
int |
size of the selection including both final and provisional selected items.
|
toString
public String toString ()