Package net.minidev.json.actions.path
Class TreePath
- java.lang.Object
-
- net.minidev.json.actions.path.TreePath
-
public class TreePath extends Object
TreePath
represents an n-gram formatted path corresponding to a branch in a tree ofMap
s andList
sSee package-info for more details
- Author:
- [email protected]
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TreePath.Step
-
Field Summary
Fields Modifier and Type Field Description protected String
currKey
protected PathDelimiter
delim
protected List<String>
keys
protected ListIterator<String>
keysItr
protected TreePath.Step
lastStep
protected StringBuilder
origin
protected String
path
protected StringBuilder
remainder
-
Constructor Summary
Constructors Constructor Description TreePath(String path, PathDelimiter delim)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TreePath
clone()
String
curr()
boolean
equals(Object o)
String
first()
int
hashCode()
boolean
hasNext()
boolean
hasPrev()
String
last()
int
length()
String
next()
int
nextIndex()
String
origin()
String
path()
String
prev()
int
prevIndex()
String
remainder()
void
reset()
String
subPath(int firstIndex, int lastIndex)
-
-
-
Field Detail
-
path
protected final String path
-
keysItr
protected ListIterator<String> keysItr
-
currKey
protected String currKey
-
lastStep
protected TreePath.Step lastStep
-
origin
protected StringBuilder origin
-
remainder
protected StringBuilder remainder
-
delim
protected PathDelimiter delim
-
-
Constructor Detail
-
TreePath
public TreePath(String path, PathDelimiter delim)
-
-
Method Detail
-
reset
public void reset()
-
hasNext
public boolean hasNext()
-
nextIndex
public int nextIndex()
-
next
public String next()
-
hasPrev
public boolean hasPrev()
-
prevIndex
public int prevIndex()
-
prev
public String prev()
-
path
public String path()
- Returns:
- An n-gram path from the first key to the current key (inclusive)
-
origin
public String origin()
- Returns:
- An n-gram path from the first key to the current key (inclusive)
-
remainder
public String remainder()
- Returns:
- An n-gram path from the current key to the last key (inclusive)
-
first
public String first()
- Returns:
- first element in the JSONPath
-
last
public String last()
- Returns:
- last element in the JSONPath
-
curr
public String curr()
- Returns:
- current element pointed to by the path iterator
-
length
public int length()
-
subPath
public String subPath(int firstIndex, int lastIndex)
-
clone
public TreePath clone() throws CloneNotSupportedException
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
-