cc.plural.jsonij
Class StringImp

java.lang.Object
  extended by cc.plural.jsonij.Value
      extended by cc.plural.jsonij.StringImp
All Implemented Interfaces:
Serializable, CharSequence, Comparable<Value>
Direct Known Subclasses:
JSON.String

public class StringImp
extends Value
implements Serializable, CharSequence

JSON String Implementation.

Version:
1.0.0
Author:
openecho
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class cc.plural.jsonij.Value
Value.TYPE
 
Field Summary
protected  String value
          Container for the String.
 
Fields inherited from class cc.plural.jsonij.Value
valueType
 
Constructor Summary
StringImp(String orig)
          Constructor using java.lang.String.
 
Method Summary
 char charAt(int index)
           
 boolean equals(Object o)
           
 int hashCode()
           
protected  Value.TYPE internalType()
          Internal Method to find the internalType for the Object.
 int length()
           
 int nestedSize()
          Finds the nested elements under this Value.
 CharSequence subSequence(int start, int end)
           
 String toJSON()
          Converts the current Value into a JSON String that represents it.
 String toString()
          Default toString for a JSON Value.
 
Methods inherited from class cc.plural.jsonij.Value
compareTo, get, get, getBoolean, getDouble, getInt, getNumber, getString, getValueType, has, isNull, size, type, valueKeySet
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected String value
Container for the String.

Constructor Detail

StringImp

public StringImp(String orig)
Constructor using java.lang.String.

Parameters:
orig - The original String for this Value
Method Detail

internalType

protected Value.TYPE internalType()
Description copied from class: Value
Internal Method to find the internalType for the Object. Must be implemented and not return null.

Specified by:
internalType in class Value
Returns:
The internalType of this JSON Value.

charAt

public char charAt(int index)
Specified by:
charAt in interface CharSequence

length

public int length()
Specified by:
length in interface CharSequence

subSequence

public CharSequence subSequence(int start,
                                int end)
Specified by:
subSequence in interface CharSequence

equals

public boolean equals(Object o)
Overrides:
equals in class Value

hashCode

public int hashCode()
Overrides:
hashCode in class Value

toString

public String toString()
Description copied from class: Value
Default toString for a JSON Value. Returns the JSON string for the Value.

Specified by:
toString in interface CharSequence
Overrides:
toString in class Value

nestedSize

public int nestedSize()
Description copied from class: Value
Finds the nested elements under this Value. This is effectively the count of all JSON Values attached to this Value. This number does not include this value itself.

Specified by:
nestedSize in class Value
Returns:
int The count of all Values attached to this Value.

toJSON

public String toJSON()
Description copied from class: Value
Converts the current Value into a JSON String that represents it.

Specified by:
toJSON in class Value
Returns:
The JSON Value as JSON String.


Copyright © 2012. All Rights Reserved.