Example usage for org.apache.commons.collections.primitives ArrayByteList ArrayByteList

List of usage examples for org.apache.commons.collections.primitives ArrayByteList ArrayByteList

Introduction

In this page you can find the example usage for org.apache.commons.collections.primitives ArrayByteList ArrayByteList.

Prototype

public ArrayByteList(byte[] array) 

Source Link

Document

Constructs a list by copying the specified array.

Usage

From source file:de.unibayreuth.bayeos.goat.table.MassenTableModel.java

private void removeRows(int[] r) {
    ByteList stat = new ArrayByteList(r.length);
    IntList von = new ArrayIntList(r.length);
    DoubleList wert = new ArrayDoubleList(r.length);

    for (int i = 0; i < r.length; i++) {
        stat.add(statusList.get(r[i]));// ww w .j  av a 2s .com
        von.add(vonList.get(r[i]));
        wert.add(wertList.get(r[i]));
    }
    statusList.removeAll(stat);
    vonList.removeAll(von);
    wertList.removeAll(wert);
}

From source file:de.unibayreuth.bayeos.goat.table.MassenTableModel.java

public boolean load(ObjektNode objekt, TimeFilter tFilter, StatusFilter sFilter) {
    try {/*from ww  w  .j av a 2 s  .  c  o m*/

        Vector params = new Vector();
        params.add(objekt.getId());
        params.add(tFilter.getVector());
        params.add(sFilter.getVector());
        Vector vReturn = (Vector) xmlClient.execute("MassenTableHandler.getRows", params);
        // Rows als byte[]
        byte[] ba = (byte[]) vReturn.elementAt(1);

        statusList = new ArrayByteList(ba.length / rowLength);
        vonList = new ArrayIntList(ba.length / rowLength);
        wertList = new ArrayDoubleList(ba.length / rowLength);

        ByteBuffer b = ByteBuffer.wrap(ba);
        while (b.hasRemaining()) {
            vonList.add(b.getInt());
            wertList.add((double) b.getFloat());
            statusList.add(b.get());
        }
        vReturn = null;
        logger.debug("MassenTableModel filled with " + getRowCount() + " records.");
        return true;
    } catch (XmlRpcException e) {
        MsgBox.error(e.getMessage());
        return false;
    }
}