Package com.addthis.bundle.value

Examples of com.addthis.bundle.value.ValueObject


                Bytes.writeString(field.getName(), out);
            } else {
                out.write(TYPE.BUNDLE_FIELD_INDEX.val);
                Bytes.writeLength(fieldIndex, out);
            }
            ValueObject val = row.getValue(field);
            encodeValue(val, out, classMap);
        }
        out.write(TYPE.BUNDLE_END.val);
    }
View Full Code Here


            while (true) {
                typever = in.read();
                switch (type = typeMap.get(typever)) {
                    case BUNDLE_FIELD_INDEX:
                        int fi = 0;
                        ValueObject vo = null;
                        BundleField field;
                        try {
                            fi = in.read();
                            vo = decodeValue(in, classMap);
                            field = fieldMap.getObject(fi);
View Full Code Here

                return arr;
            case MAP:
                ValueMap map = ValueFactory.createMap();
                long count = Bytes.readLength(in);
                while (count-- > 0) {
                    ValueObject key = decodeValue(in, classMap);
                    ValueObject val = decodeValue(in, classMap);
                    map.put(key.toString(), val);
                }
                return map;
            case CUSTOM_INDEX:
                Class<? extends ValueObject> ci = classMap.getObject((int) Bytes.readLength(in));
View Full Code Here

                Bytes.writeString(field.getName(), out);
            } else {
                out.write(TYPE.BUNDLE_FIELD_INDEX.val);
                Bytes.writeLength(fieldIndex, out);
            }
            ValueObject val = row.getValue(field);
            encodeValue(val, out, classMap);
        }
        out.write(TYPE.BUNDLE_END.val);
    }
View Full Code Here

            while (true) {
                typever = in.read();
                switch (type = typeMap.get(typever)) {
                    case BUNDLE_FIELD_INDEX:
                        int fi = 0;
                        ValueObject vo = null;
                        BundleField field;
                        try {
                            fi = in.read();
                            vo = decodeValue(in, classMap);
                            field = fieldMap.getObject(fi);
View Full Code Here

                return arr;
            case MAP:
                ValueMap map = ValueFactory.createMap();
                long count = Bytes.readLength(in);
                while (count-- > 0) {
                    ValueObject key = decodeValue(in, classMap);
                    ValueObject val = decodeValue(in, classMap);
                    map.put(key.toString(), val);
                }
                return map;
            case CUSTOM_INDEX:
                Class<? extends ValueObject> ci = classMap.getObject((int) Bytes.readLength(in));
View Full Code Here

        builder.append("{");
        Iterator<BundleField> iterator = bundle.iterator();
        while (iterator.hasNext()) {
            BundleField field = iterator.next();
            String fieldName = field.getName();
            ValueObject value = bundle.getValue(field);
            String formatValue = printValueObject(value);
            builder.append("\"");
            builder.append(fieldName);
            builder.append("\" = ");
            builder.append(formatValue);
View Full Code Here

            @Override
            public boolean hasNext() {
                while (peek == null && iter.hasNext()) {
                    BundleField next = iter.next();
                    ValueObject value = getRawValue(next);
                    if (value == SKIP) {
                        continue;
                    }
                    peek = next;
                    break;
View Full Code Here

        };
    }

    @Override
    public ValueObject getValue(BundleField field) throws BundleException {
        ValueObject value = getRawValue(field);
        if (value == SKIP) {
            return null;
        }
        return value;
    }
View Full Code Here

            Integer index = field.getIndex();
            if (index != null) {
                while (bundle.size() <= index) {
                    bundle.add(SKIP);
                }
                ValueObject prev = bundle.set(index, value);
                if (prev == SKIP) {
                    count++;
                }
            }
        }
View Full Code Here

TOP

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

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.