Example usage for android.util SparseIntArray clear

List of usage examples for android.util SparseIntArray clear

Introduction

In this page you can find the example usage for android.util SparseIntArray clear.

Prototype

public void clear() 

Source Link

Document

Removes all key-value mappings from this SparseIntArray.

Usage

From source file:com.google.android.flexbox.FlexboxHelper.java

private int[] sortOrdersIntoReorderedIndices(int childCount, List<Order> orders, SparseIntArray orderCache) {
    Collections.sort(orders);/* www .  jav a2 s.co m*/
    orderCache.clear();
    int[] reorderedIndices = new int[childCount];
    int i = 0;
    for (Order order : orders) {
        reorderedIndices[i] = order.index;
        orderCache.append(order.index, order.order);
        i++;
    }
    return reorderedIndices;
}