Class JsonReader.Key
- java.lang.Object
-
- com.smartgridready.communicator.common.helper.JsonReader.Key
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<JsonReader.Key>
- Enclosing class:
- JsonReader
public static class JsonReader.Key extends java.lang.Object implements java.lang.Comparable<JsonReader.Key>, java.io.Serializable
Implements a map key. Contains a list of indices.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index)Adds an index to the key.intcompareTo(JsonReader.Key o)static JsonReader.Keycopy(JsonReader.Key srcKey)Clones the instance.booleanequals(java.lang.Object o)inthashCode()intindexAt(int iteration)Gets the element at a given position.java.lang.Stringkey()Gets the key as string.
-
-
-
Method Detail
-
add
public void add(int index)
Adds an index to the key.- Parameters:
index- the index position
-
key
public java.lang.String key()
Gets the key as string.- Returns:
- a string containing all indices.
-
indexAt
public int indexAt(int iteration)
Gets the element at a given position.- Parameters:
iteration- the position- Returns:
- an integer
-
compareTo
public int compareTo(JsonReader.Key o)
- Specified by:
compareToin interfacejava.lang.Comparable<JsonReader.Key>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
copy
public static JsonReader.Key copy(JsonReader.Key srcKey)
Clones the instance.- Parameters:
srcKey- the source instance- Returns:
- a new instance
-
-