Example usage for org.apache.mahout.math Arrays trimToCapacity

List of usage examples for org.apache.mahout.math Arrays trimToCapacity

Introduction

In this page you can find the example usage for org.apache.mahout.math Arrays trimToCapacity.

Prototype

public static boolean[] trimToCapacity(boolean[] array, int maxCapacity) 

Source Link

Document

Ensures that the specified array cannot hold more than maxCapacity elements.

Usage

From source file:gov.vha.isaac.ochre.collections.uuidnidmap.UuidArrayList.java

License:Apache License

/**
 * Trims the capacity of the receiver to be the receiver's current size.
 * Releases any superfluous internal memory. An application can use this
 * operation to minimize the storage of the receiver.
 *///  w w  w.ja  v  a 2  s.c  om
@Override
public void trimToSize() {
    elements = Arrays.trimToCapacity(elements, size() * 2 + 1);
}

From source file:sh.isaac.api.collections.uuidnidmap.UuidArrayList.java

License:Apache License

/**
 * Trims the capacity of the receiver to be the receiver's current size.
 * Releases any superfluous internal memory. An application can use this
 * operation to minimize the storage of the receiver.
 *///  www.j a  v  a2s.  c  om
@Override
public void trimToSize() {
    this.elements = Arrays.trimToCapacity(this.elements, size() * 2 + 1);
}