org.codehaus.jackson.node
Class DoubleNode

java.lang.Object
  extended by org.codehaus.jackson.JsonNode
      extended by org.codehaus.jackson.node.BaseJsonNode
          extended by org.codehaus.jackson.node.ValueNode
              extended by org.codehaus.jackson.node.NumericNode
                  extended by org.codehaus.jackson.node.DoubleNode
All Implemented Interfaces:
Iterable<JsonNode>, JsonSerializable

public final class DoubleNode
extends NumericNode

Numeric node that contains 64-bit ("double precision") floating point values simple 32-bit integer values.


Constructor Summary
DoubleNode(double v)
           
 
Method Summary
 JsonToken asToken()
          Method that can be used for efficient type detection when using stream abstraction for traversing nodes.
 boolean equals(Object o)
           Note: marked as abstract to ensure all implementation classes define it properly.
 BigInteger getBigIntegerValue()
           
 BigDecimal getDecimalValue()
           
 double getDoubleValue()
           
 int getIntValue()
           
 long getLongValue()
           
 JsonParser.NumberType getNumberType()
          If this node is a numeric type (as per JsonNode.isNumber()), returns native type that node uses to store the numeric value.
 Number getNumberValue()
          Returns numeric value for this node, if and only if this node is numeric (JsonNode.isNumber() returns true); otherwise returns null
 String getValueAsText()
          Method that will return valid String representation of the container value, if the node is a value node (method JsonNode.isValueNode() returns true), otherwise null.
 int hashCode()
           
 boolean isDouble()
           
 boolean isFloatingPointNumber()
           
 void serialize(JsonGenerator jg, SerializerProvider provider)
          Method called to serialize node instances using given generator.
static DoubleNode valueOf(double v)
           
 
Methods inherited from class org.codehaus.jackson.node.NumericNode
isNumber
 
Methods inherited from class org.codehaus.jackson.node.ValueNode
isValueNode, path, path, toString
 
Methods inherited from class org.codehaus.jackson.node.BaseJsonNode
traverse, writeTo
 
Methods inherited from class org.codehaus.jackson.JsonNode
append, get, get, getBinaryValue, getBooleanValue, getElements, getElementValue, getFieldNames, getFieldValue, getPath, getPath, getTextValue, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainerNode, isInt, isIntegralNumber, isLong, isMissingNode, isNull, isObject, isPojo, isTextual, iterator, size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleNode

public DoubleNode(double v)
Method Detail

valueOf

public static DoubleNode valueOf(double v)

asToken

public JsonToken asToken()
Description copied from class: BaseJsonNode
Method that can be used for efficient type detection when using stream abstraction for traversing nodes. Will return the first JsonToken that equivalent stream event would produce (for most nodes there is just one token but for structured/container types multiple)

Specified by:
asToken in class ValueNode

getNumberType

public JsonParser.NumberType getNumberType()
Description copied from class: JsonNode
If this node is a numeric type (as per JsonNode.isNumber()), returns native type that node uses to store the numeric value.

Specified by:
getNumberType in class NumericNode

isFloatingPointNumber

public boolean isFloatingPointNumber()
Overrides:
isFloatingPointNumber in class JsonNode
Returns:
True if this node represents a non-integral numeric Json value

isDouble

public boolean isDouble()
Overrides:
isDouble in class JsonNode

getNumberValue

public Number getNumberValue()
Description copied from class: JsonNode
Returns numeric value for this node, if and only if this node is numeric (JsonNode.isNumber() returns true); otherwise returns null

Specified by:
getNumberValue in class NumericNode
Returns:
Number value this node contains, if any (null for non-number nodes).

getIntValue

public int getIntValue()
Specified by:
getIntValue in class NumericNode

getLongValue

public long getLongValue()
Specified by:
getLongValue in class NumericNode

getDoubleValue

public double getDoubleValue()
Specified by:
getDoubleValue in class NumericNode

getDecimalValue

public BigDecimal getDecimalValue()
Specified by:
getDecimalValue in class NumericNode

getBigIntegerValue

public BigInteger getBigIntegerValue()
Specified by:
getBigIntegerValue in class NumericNode

getValueAsText

public String getValueAsText()
Description copied from class: JsonNode
Method that will return valid String representation of the container value, if the node is a value node (method JsonNode.isValueNode() returns true), otherwise null.

Note: to serialize nodes of any type, you should call JsonNode.toString() instead.

Specified by:
getValueAsText in class NumericNode

serialize

public final void serialize(JsonGenerator jg,
                            SerializerProvider provider)
                     throws IOException,
                            JsonProcessingException
Description copied from class: BaseJsonNode
Method called to serialize node instances using given generator.

Specified by:
serialize in interface JsonSerializable
Specified by:
serialize in class BaseJsonNode
Throws:
IOException
JsonProcessingException

equals

public boolean equals(Object o)
Description copied from class: JsonNode

Note: marked as abstract to ensure all implementation classes define it properly.

Specified by:
equals in class JsonNode

hashCode

public int hashCode()
Overrides:
hashCode in class Object