Examples of TByteList


Examples of gnu.trove.list.TByteList

        sort(0, size);
    }

    /** {@inheritDoc} */
    public void sort(int fromIndex, int toIndex) {
        TByteList tmp = subList(fromIndex, toIndex);
        byte[] vals = tmp.toArray();
        Arrays.sort(vals);
        set(fromIndex, vals);
    }
View Full Code Here

Examples of gnu.trove.list.TByteList

        };
    }

    /** {@inheritDoc} */
    public TByteList grep(TByteProcedure condition) {
        TByteList ret = new TByteLinkedList();
        for (TByteLink l = head; got(l); l = l.getNext()) {
            if (condition.execute(l.getValue()))
                ret.add(l.getValue());
        }
        return ret;
    }
View Full Code Here

Examples of gnu.trove.list.TByteList

        return ret;
    }

    /** {@inheritDoc} */
    public TByteList inverseGrep(TByteProcedure condition) {
        TByteList ret = new TByteLinkedList();
        for (TByteLink l = head; got(l); l = l.getNext()) {
            if (!condition.execute(l.getValue()))
                ret.add(l.getValue());
        }
        return ret;
    }
View Full Code Here

Examples of gnu.trove.list.TByteList

                extractPrimitive(value, json);
            } else if (json.isJsonObject()) {
                extractMap(json, context, value);
            } else if (json.isJsonArray()) {
                JsonArray jsonArray = json.getAsJsonArray();
                TByteList byteList = new TByteArrayList();
                for (JsonElement element : jsonArray) {
                    if (element.isJsonArray()) {
                        value.addValue((EntityData.Value) context.deserialize(element, EntityData.Value.class));
                    } else if (json.isJsonObject()) {
                        extractMap(json, context, value);
                    } else if (element.isJsonPrimitive()) {
                        extractPrimitive(value, element);
                        if (element.getAsJsonPrimitive().isNumber()) {
                            try {
                                byteList.add(element.getAsByte());
                            } catch (NumberFormatException nfe) {
                                byteList.add((byte) 0);
                            }
                        }
                    }
                }
                value.setBytes(ByteString.copyFrom(byteList.toArray()));
            }
            return value.build();
        }
View Full Code Here

Examples of gnu.trove.list.TByteList

        return builder.build();
    }

    private static EntityData.RunLengthEncoding8 runLengthEncode8(TeraArray array) {
        EntityData.RunLengthEncoding8.Builder builder = EntityData.RunLengthEncoding8.newBuilder();
        TByteList values = new TByteArrayList(16384);
        byte lastItem = (byte) array.get(0, 0, 0);
        int counter = 0;
        for (int y = 0; y < array.getSizeY(); ++y) {
            for (int z = 0; z < array.getSizeZ(); ++z) {
                for (int x = 0; x < array.getSizeX(); ++x) {
                    byte item = (byte) array.get(x, y, z);
                    if (lastItem != item) {
                        builder.addRunLengths(counter);
                        values.add(lastItem);
                        lastItem = item;
                        counter = 1;
                    } else {
                        counter++;
                    }
                }
            }
        }
        if (lastItem != 0) {
            builder.addRunLengths(counter);
            values.add(lastItem);
        }
        builder.setValues(ByteString.copyFrom(values.toArray()));
        return builder.build();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.