Package com.addthis.bundle.value

Examples of com.addthis.bundle.value.ValueArray


            return null;
        }
        if (v.getObjectType() == ValueObject.TYPE.ARRAY) {
            return v.asArray();
        }
        ValueArray arr = ValueFactory.createArray(1);
        arr.append(v);
        return arr;
    }
View Full Code Here


                    encodeValue(e.getValue(), out, classIndex);
                }
                break;
            case ARRAY:
                out.write(TYPE.ARRAY.val);
                ValueArray arr = val.asArray();
                Bytes.writeLength(arr.size(), out);
                for (ValueObject vo : arr) {
                    encodeValue(vo, out, classIndex);
                }
                break;
            case STRING:
View Full Code Here

                return ValueFactory.create(Double.longBitsToDouble(Bytes.readLong(in)));
            case STRING:
                return ValueFactory.create(Bytes.readString(in));
            case ARRAY:
                int len = (int) Bytes.readLength(in);
                ValueArray arr = ValueFactory.createArray(len);
                for (int i = 0; i < len; i++) {
                    arr.append(decodeValue(in, classMap));
                }
                return arr;
            case MAP:
                ValueMap map = ValueFactory.createMap();
                long count = Bytes.readLength(in);
View Full Code Here

                    encodeValue(e.getValue(), out, classIndex);
                }
                break;
            case ARRAY:
                out.write(TYPE.ARRAY.val);
                ValueArray arr = val.asArray();
                Bytes.writeLength(arr.size(), out);
                for (ValueObject vo : arr) {
                    encodeValue(vo, out, classIndex);
                }
                break;
            case STRING:
View Full Code Here

                return ValueFactory.create(Double.longBitsToDouble(Bytes.readLong(in)));
            case STRING:
                return ValueFactory.create(Bytes.readString(in));
            case ARRAY:
                int len = (int) Bytes.readLength(in);
                ValueArray arr = ValueFactory.createArray(len);
                for (int i = 0; i < len; i++) {
                    arr.add(decodeValue(in, classMap));
                }
                return arr;
            case MAP:
                ValueMap map = ValueFactory.createMap();
                long count = Bytes.readLength(in);
View Full Code Here

            return null;
        }
        if (v.getObjectType() == ValueObject.TYPE.ARRAY) {
            return v.asArray();
        }
        ValueArray arr = ValueFactory.createArray(1);
        arr.add(v);
        return arr;
    }
View Full Code Here

        if (valueObject == null) {
            return "null";
        } else if (valueObject instanceof ValueString) {
            return '"' + valueObject.toString() + '"';
        } else if (valueObject instanceof ValueArray) {
            ValueArray asArray = (ValueArray) valueObject;
            StringBuilder builder = new StringBuilder();
            builder.append('[');
            for (int i = 0; i < asArray.size(); i++) {
                builder.append(printValueObject(asArray.get(i)));
                if (i < asArray.size() - 1) {
                    builder.append(" , ");
                }
            }
            builder.append(']');
            return builder.toString();
View Full Code Here

        if (valueObject == null) {
            return "null";
        } else if (valueObject instanceof ValueString) {
            return '"' + valueObject.toString() + '"';
        } else if (valueObject instanceof ValueArray) {
            ValueArray asArray = (ValueArray) valueObject;
            StringBuilder builder = new StringBuilder();
            builder.append('[');
            for (int i = 0; i < asArray.size(); i++) {
                builder.append(printValueObject(asArray.get(i)));
                if (i < asArray.size() - 1) {
                    builder.append(" , ");
                }
            }
            builder.append(']');
            return builder.toString();
View Full Code Here

            return null;
        }
        if (v.getObjectType() == ValueObject.TYPE.ARRAY) {
            return v.asArray();
        }
        ValueArray arr = ValueFactory.createArray(1);
        arr.add(v);
        return arr;
    }
View Full Code Here

                    encodeValue(e.getValue(), out, classIndex);
                }
                break;
            case ARRAY:
                out.write(TYPE.ARRAY.val);
                ValueArray arr = val.asArray();
                Bytes.writeLength(arr.size(), out);
                for (ValueObject vo : arr) {
                    encodeValue(vo, out, classIndex);
                }
                break;
            case STRING:
View Full Code Here

TOP

Related Classes of com.addthis.bundle.value.ValueArray

Copyright © 2018 www.massapicom. 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.