Look to HmapKey for the encoding of each entry
HmapPath
public HmapPath(HmapKey[] keyArray)
HmapPath
public HmapPath(HmapKey hmapKey)
- Create a new path
- Parameters:
hmapKey - The root entry in a new path
HmapPath
public HmapPath(HmapPath treePath,
HmapKey hmapKey)
- Parameters:
treePath - The path on which to build this pathhmapKey - The new entry
toString
public String toString()
- Overrides:
toString in class Object
- Returns:
- A stringified version of this path.
getKeyAt
public HmapKey getKeyAt(int i)
- Returns the key corresponding to a specific entry in the path.
- Parameters:
i - the entry number
- Returns:
- a correct key if one exists. Null if out of bounds
getLength
public int getLength()
- Returns:
- The length of the path
equals
public boolean equals(HmapPath ePath)
- Checks for equality with another path
- Parameters:
ePath - The path to check
- Returns:
- true of the paths are equal. false if not
subPath
public HmapPath subPath(int from,
int to)
- Returns a subpath of this path. Indices are defined as array counts: from 0 to length-1
- Parameters:
from - The entry to take from; includedto - The entry to take to; included
- Returns:
mergePaths
public static HmapPath mergePaths(HmapPath one,
HmapPath two)
- Parameters:
one - The new first part of the pathtwo - The new second part of the path
- Returns:
- A merger of two paths into one, with the first parameter as the first part of the path and the second the second
fromString
public static HmapPath fromString(String encodedString)