@Override public float getFloatValue() throws IOException { return delegate.getFloatValue(); }
@Override public float getFloatValue() throws IOException { return delegate.getFloatValue(); }
@Override public float readFFloat() throws IOException { input.nextToken(); return input.getFloatValue(); }
@Override public float getFloatValue() throws IOException { return delegate.getFloatValue(); }
@Override public Float parse(JsonParser jsonParser) throws IOException { if (jsonParser.getCurrentToken() == JsonToken.VALUE_NULL) { return null; } else { return jsonParser.getFloatValue(); } }
@Override public float readFFloat() throws IOException { input.nextToken(); return input.getFloatValue(); }
@Override public Float unmarshall(JsonUnmarshallerContext context) throws Exception { return context.getJsonParser().getFloatValue(); }
public Float unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { return unmarshallerContext.getJsonParser().getFloatValue(); }
@Override public float readFloat() throws IOException { final float value; if (parser.getCurrentToken() == VALUE_STRING) { final String textValue = parser.getText(); if ("Infinity".equals(textValue)) value = Float.POSITIVE_INFINITY; else if ("-Infinity".equals(textValue)) value = Float.NEGATIVE_INFINITY; else if ("NaN".equals(textValue)) value = Float.NaN; else value = parser.getFloatValue(); } else value = parser.getFloatValue(); if (lastRepeated && parser.nextToken() == END_ARRAY) lastRepeated = false; return value; }
public static Long currentTokenAsReal(JsonParser parser) throws IOException { switch (parser.currentToken()) { case VALUE_NULL: return null; case VALUE_STRING: case FIELD_NAME: return VarcharOperators.castToFloat(Slices.utf8Slice(parser.getText())); case VALUE_NUMBER_FLOAT: return (long) floatToRawIntBits(parser.getFloatValue()); case VALUE_NUMBER_INT: // An alternative is calling getLongValue and then BigintOperators.castToReal. // It doesn't work as well because it can result in overflow and underflow exceptions for large integral numbers. return (long) floatToRawIntBits(parser.getFloatValue()); case VALUE_TRUE: return BooleanOperators.castToReal(true); case VALUE_FALSE: return BooleanOperators.castToReal(false); default: throw new JsonCastException(format("Unexpected token when cast to %s: %s", StandardTypes.REAL, parser.getText())); } }
@Override public float readFloat() throws IOException { advance(Symbol.FLOAT); if (in.getCurrentToken().isNumeric()) { float result = in.getFloatValue(); in.nextToken(); return result; } else { throw error("float"); } }
for (int i = 0; i < da.length; i++) { input.nextToken(); da[i] = input.getFloatValue();
return p.getFloatValue(); return p.getFloatValue(); case JsonTokenId.ID_NULL: _verifyNullForPrimitive(ctxt);
writeNumber(p.getDecimalValue()); } else if (n == NumberType.FLOAT) { writeNumber(p.getFloatValue()); } else { writeNumber(p.getDoubleValue());
return p.getFloatValue();
writeNumber(p.getDecimalValue()); } else if (n == NumberType.FLOAT) { writeNumber(p.getFloatValue()); } else { writeNumber(p.getDoubleValue());
protected final JsonNode _fromFloat(JsonParser p, DeserializationContext ctxt, final JsonNodeFactory nodeFactory) throws IOException { JsonParser.NumberType nt = p.getNumberType(); if (nt == JsonParser.NumberType.BIG_DECIMAL) { return nodeFactory.numberNode(p.getDecimalValue()); } if (ctxt.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)) { // 20-May-2016, tatu: As per [databind#1028], need to be careful // (note: JDK 1.8 would have `Double.isFinite()`) if (p.isNaN()) { return nodeFactory.numberNode(p.getDoubleValue()); } return nodeFactory.numberNode(p.getDecimalValue()); } if (nt == JsonParser.NumberType.FLOAT) { return nodeFactory.numberNode(p.getFloatValue()); } return nodeFactory.numberNode(p.getDoubleValue()); }
break; case FLOAT: pih.addFloatField(jp.getFloatValue()); break; case INT: {
break; case FLOAT: pih.addFloatField(fieldName, jp.getFloatValue()); break; case INT: {
break; case FLOAT: writeNumber(p.getFloatValue()); break; default: