Example usage for android.support.v4.util CircularArray getFirst

List of usage examples for android.support.v4.util CircularArray getFirst

Introduction

In this page you can find the example usage for android.support.v4.util CircularArray getFirst.

Prototype

public final E getFirst() 

Source Link

Usage

From source file:com.appsimobile.util.ArrayUtils.java

public static <T> void sort(CircularArray<T> list, Comparator<? super T> comparator) {
    if (list.isEmpty())
        return;/*from w ww  .jav  a2  s.c o m*/
    T first = list.getFirst();
    T[] array = (T[]) Array.newInstance(first.getClass(), list.size());
    array = toArray(list, array);

    Arrays.sort(array, comparator);
    list.clear();
    for (T item : array) {
        list.addLast(item);
    }
}