de.hpi.fgis.dude.util.data.json
Interface JsonValue

All Superinterfaces:
AutoJsonable, Comparable<JsonValue>, Jsonable
All Known Subinterfaces:
JsonAtomic
All Known Implementing Classes:
JsonArray, JsonBoolean, JsonNull, JsonNumber, JsonRecord, JsonString

public interface JsonValue
extends Jsonable, Comparable<JsonValue>

JsonValue provides methods that has to be implemented by every Json data type.

Author:
Matthias Pohl

Nested Class Summary
static class JsonValue.JsonType
          JsonValue.JsonType includes all Json types that can be returned by getType().
 
Method Summary
 int compareTo(JsonValue value)
          Compares the current instance with the passed JsonValue.
 JsonValue.JsonType getType()
          Returns the type of the current instance.
 int size()
          The size of the current instance.
 
Methods inherited from interface de.hpi.fgis.dude.util.data.Jsonable
fromJson, toJson
 

Method Detail

getType

JsonValue.JsonType getType()
Returns the type of the current instance.

Returns:
The type of the current instance.

size

int size()
The size of the current instance. The size is the number of actual Java instances that are included in this Json instance.

Returns:
The number of concrete Java objects that are collected by the current instance.

compareTo

int compareTo(JsonValue value)
Compares the current instance with the passed JsonValue. Instances of different JsonValue.JsonTypes are ordered lexicographically except for JsonValue.JsonType.Null. The above mentioned requirements define the following order: null == JsonValue.JsonType.Null < JsonValue.JsonType.Array < JsonValue.JsonType.Boolean < JsonValue.JsonType.Number < JsonValue.JsonType.Record < JsonValue.JsonType.String.

Specified by:
compareTo in interface Comparable<JsonValue>
See Also:
Comparable.compareTo(Object)


Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.