Examples of asBigDecimal()


Examples of com.foundationdb.server.types.common.BigDecimalWrapper.asBigDecimal()

        }

        @Override
        protected Object rawFromValue(ValueSource value) {
            BigDecimalWrapper wrapper = TBigDecimal.getWrapper(value, type);
            return wrapper.asBigDecimal().unscaledValue().longValue();
        }
    }

    // TODO: This is whatever byte encoding ConversionHelperBigDecimal uses.
    // Is that what we want?
View Full Code Here

Examples of com.foundationdb.server.types.common.BigDecimalWrapper.asBigDecimal()

        @Override
        protected Object rawFromValue(ValueSource value) {
            BigDecimalWrapper wrapper = TBigDecimal.getWrapper(value, type);
            int precision = type.attribute(DecimalAttribute.PRECISION);
            int scale = type.attribute(DecimalAttribute.SCALE);
            return ByteString.copyFrom(ConversionHelperBigDecimal.bytesFromObject(wrapper.asBigDecimal(), precision, scale));
        }
    }
}
View Full Code Here

Examples of com.foundationdb.server.types.common.BigDecimalWrapper.asBigDecimal()

            RowDataValueSource rowDataValueSource = (RowDataValueSource)rowDataSource;
            TClass tclass = tinstances[d].typeClass();
            if (tclass == MNumeric.DECIMAL) {
                BigDecimalWrapper wrapper = TBigDecimal.getWrapper(rowDataValueSource, tinstances[d]);
                coords[d] = wrapper.asBigDecimal().doubleValue();
            }
            else if (tclass == MNumeric.BIGINT) {
                coords[d] = rowDataValueSource.getInt64();
            }
            else if (tclass == MNumeric.INT) {
View Full Code Here

Examples of com.foundationdb.server.types.common.BigDecimalWrapper.asBigDecimal()

                                                           cached,
                                                           outT));
                else if (outT == MNumeric.DECIMAL)
                    output.putObject(result);
                else if (outT == MNumeric.BIGINT)
                   output.putInt64(result.asBigDecimal().longValue());
                else if (outT == MNumeric.INT) // INT
                    output.putInt32(result.asBigDecimal().intValue());
                else
                    throw new AssertionError("Unexpected output type: " + outT);
            }
View Full Code Here

Examples of com.foundationdb.server.types.common.BigDecimalWrapper.asBigDecimal()

                else if (outT == MNumeric.DECIMAL)
                    output.putObject(result);
                else if (outT == MNumeric.BIGINT)
                   output.putInt64(result.asBigDecimal().longValue());
                else if (outT == MNumeric.INT) // INT
                    output.putInt32(result.asBigDecimal().intValue());
                else
                    throw new AssertionError("Unexpected output type: " + outT);
            }

            @Override
View Full Code Here

Examples of com.foundationdb.server.types.common.BigDecimalWrapper.asBigDecimal()

        // If the incoming ValueSource is a DECIMAL, *and* it has a cache value (ie an BigDecimalWrapper), then
        // we can just copy the wrapper into the output. If the incoming is a DECIMAL with bytes (its raw form), we
        // can only copy those bytes if the TInstance match -- and super.tryFromObject already makes that check.
        if (in.getType().typeClass() instanceof TBigDecimal && in.hasCacheValue()) {
            BigDecimalWrapper cached = (BigDecimalWrapper) in.getObject();
            out.putObject(new BigDecimalWrapperImpl(cached.asBigDecimal()));
            return true;
        }
        return super.tryFromObject(context, in, out);
    }

View Full Code Here

Examples of com.workingdogs.village.Value.asBigDecimal()

                    {
                        obj2 = new Byte(value.asByte());
                    }
                    if (value.isBigDecimal())
                    {
                        obj2 = value.asBigDecimal();
                    }
                    if (value.isBytes())
                    {
                        obj2 = value.asBytes();
                    }
View Full Code Here

Examples of com.workingdogs.village.Value.asBigDecimal()

                ||  columnNames[j].equalsIgnoreCase( OBJECT_DATA_COLUMN ) ))
            {
                Object obj2 = null;
                Value value = row.getValue(j+1);
                if (value.isByte()) obj2 = new Byte(value.asByte());
                if (value.isBigDecimal()) obj2 = value.asBigDecimal();
                if (value.isBytes()) obj2 = value.asBytes();
                if (value.isDate()) obj2 = value.asDate();
                if (value.isShort()) obj2 = new Short(value.asShort());
                if (value.isInt()) obj2 = new Integer(value.asInt());
                if (value.isLong()) obj2 = new Long(value.asLong());
View Full Code Here

Examples of com.workingdogs.village.Value.asBigDecimal()

                Object obj2 = null;
                Value value = row.getValue(j+1);
                if (value.isString())
                    obj2 = value.asString();
                else if (value.isBigDecimal())
                    obj2 = value.asBigDecimal();
                else if (value.isBytes())
                    obj2 = value.asBytes();
                else if (value.isDate())
                    obj2 = value.asDate();
                else if (value.isShort())
View Full Code Here

Examples of com.workingdogs.village.Value.asBigDecimal()

                    {
                        obj2 = new Byte(value.asByte());
                    }
                    if (value.isBigDecimal())
                    {
                        obj2 = value.asBigDecimal();
                    }
                    if (value.isBytes())
                    {
                        obj2 = value.asBytes();
                    }
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.