SortedListAdapterCallback
public
abstract
class
SortedListAdapterCallback
extends Callback<T2>
A SortedList.Callback
implementation that can bind a SortedList
to a
RecyclerView.Adapter
.
Summary
Public methods |
void
|
onChanged(int position, int count)
Called by the SortedList when the item at the given position is updated.
|
void
|
onInserted(int position, int count)
Called by the SortedList when an item is inserted at the given position.
|
void
|
onMoved(int fromPosition, int toPosition)
Called by the SortedList when an item changes its position in the list.
|
void
|
onRemoved(int position, int count)
Called by the SortedList when an item is removed from the given position.
|
Inherited methods |
From
class
android.support.v7.util.SortedList.Callback
abstract
boolean
|
areContentsTheSame(T2 oldItem, T2 newItem)
Called by the SortedList when it wants to check whether two items have the same data
or not.
|
abstract
boolean
|
areItemsTheSame(T2 item1, T2 item2)
Called by the SortedList to decide whether two object represent the same Item or not.
|
abstract
int
|
compare(T2 o1, T2 o2)
Similar to compare(Object, Object) , should compare two and
return how they should be ordered.
|
abstract
void
|
onChanged(int position, int count)
Called by the SortedList when the item at the given position is updated.
|
abstract
void
|
onInserted(int position, int count)
Called by the SortedList when an item is inserted at the given position.
|
abstract
void
|
onMoved(int fromPosition, int toPosition)
Called by the SortedList when an item changes its position in the list.
|
abstract
void
|
onRemoved(int position, int count)
Called by the SortedList when an item is removed from the given position.
|
|
From
class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long millis, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long millis)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
|
From
interface
java.util.Comparator
abstract
int
|
compare(T2 o1, T2 o2)
Compares its two arguments for order.
|
static
<T, U>
Comparator<T2>
|
comparing(Function<? super T, ? extends U> keyExtractor, Comparator<? super U> keyComparator)
Accepts a function that extracts a sort key from a type T , and
returns a Comparator<T> that compares by that sort key using
the specified Comparator .
|
static
<T, U extends Comparable<? super U>>
Comparator<T2>
|
comparing(Function<? super T, ? extends U> keyExtractor)
Accepts a function that extracts a Comparable sort key from a type T , and returns a Comparator<T> that compares by that sort key.
|
static
<T>
Comparator<T2>
|
comparingDouble(ToDoubleFunction<? super T> keyExtractor)
Accepts a function that extracts a double sort key from a type
T , and returns a Comparator<T> that compares by that
sort key.
|
static
<T>
Comparator<T2>
|
comparingInt(ToIntFunction<? super T> keyExtractor)
Accepts a function that extracts an int sort key from a type
T , and returns a Comparator<T> that compares by that
sort key.
|
static
<T>
Comparator<T2>
|
comparingLong(ToLongFunction<? super T> keyExtractor)
Accepts a function that extracts a long sort key from a type
T , and returns a Comparator<T> that compares by that
sort key.
|
abstract
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this
comparator.
|
static
<T extends Comparable<? super T>>
Comparator<T>
|
naturalOrder()
Returns a comparator that compares Comparable objects in natural
order.
|
static
<T>
Comparator<T2>
|
nullsFirst(Comparator<? super T> comparator)
Returns a null-friendly comparator that considers null to be
less than non-null.
|
static
<T>
Comparator<T2>
|
nullsLast(Comparator<? super T> comparator)
Returns a null-friendly comparator that considers null to be
greater than non-null.
|
static
<T extends Comparable<? super T>>
Comparator<T>
|
reverseOrder()
Returns a comparator that imposes the reverse of the natural
ordering.
|
default
Comparator<T2>
|
reversed()
Returns a comparator that imposes the reverse ordering of this
comparator.
|
default
<U extends Comparable<? super U>>
Comparator<T2>
|
thenComparing(Function<? super T, ? extends U> keyExtractor)
Returns a lexicographic-order comparator with a function that
extracts a Comparable sort key.
|
default
<U>
Comparator<T2>
|
thenComparing(Function<? super T, ? extends U> keyExtractor, Comparator<? super U> keyComparator)
Returns a lexicographic-order comparator with a function that
extracts a key to be compared with the given Comparator .
|
default
Comparator<T2>
|
thenComparing(Comparator<? super T> other)
Returns a lexicographic-order comparator with another comparator.
|
default
Comparator<T2>
|
thenComparingDouble(ToDoubleFunction<? super T> keyExtractor)
Returns a lexicographic-order comparator with a function that
extracts a double sort key.
|
default
Comparator<T2>
|
thenComparingInt(ToIntFunction<? super T> keyExtractor)
Returns a lexicographic-order comparator with a function that
extracts a int sort key.
|
default
Comparator<T2>
|
thenComparingLong(ToLongFunction<? super T> keyExtractor)
Returns a lexicographic-order comparator with a function that
extracts a long sort key.
|
|
Public constructors
SortedListAdapterCallback
SortedListAdapterCallback (Adapter adapter)
Creates a SortedList.Callback
that will forward data change events to the provided
Adapter.
Parameters |
adapter |
Adapter :
The Adapter instance which should receive events from the SortedList.
|
Public methods
onChanged
void onChanged (int position,
int count)
Called by the SortedList when the item at the given position is updated.
Parameters |
position |
int :
The position of the item which has been updated. |
count |
int :
The number of items which has changed.
|
onInserted
void onInserted (int position,
int count)
Called by the SortedList when an item is inserted at the given position.
Parameters |
position |
int :
The position of the new item. |
count |
int :
The number of items that have been added.
|
onMoved
void onMoved (int fromPosition,
int toPosition)
Called by the SortedList when an item changes its position in the list.
Parameters |
fromPosition |
int :
The previous position of the item before the move. |
toPosition |
int :
The new position of the item.
|
onRemoved
void onRemoved (int position,
int count)
Called by the SortedList when an item is removed from the given position.
Parameters |
position |
int :
The position of the item which has been removed. |
count |
int :
The number of items which have been removed.
|