|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.facet.taxonomy.CategoryPath
public class CategoryPath
Holds a sequence of string components, specifying the hierarchical name of a category.
Field Summary | |
---|---|
String[] |
components
The components of this CategoryPath . |
static CategoryPath |
EMPTY
An empty CategoryPath |
int |
length
The number of components of this CategoryPath . |
Constructor Summary | |
---|---|
CategoryPath(String... components)
Construct from the given path components. |
|
CategoryPath(String pathString,
char delimiter)
Construct from a given path, separating path components with delimiter . |
Method Summary | |
---|---|
int |
compareTo(CategoryPath other)
Compares this path with another CategoryPath for lexicographic
order. |
int |
copyFullPath(char[] buf,
int start,
char delimiter)
Copies the path components to the given char[] , starting at index
start . |
boolean |
equals(Object obj)
|
int |
fullPathLength()
Returns the number of characters needed to represent the path, including delimiter characters, for using with copyFullPath(char[], int, char) . |
int |
hashCode()
|
long |
longHashCode()
Calculate a 64-bit hash function for this path. |
CategoryPath |
subpath(int length)
Returns a sub-path of this path up to length components. |
String |
toString()
Returns a string representation of the path, separating components with '/'. |
String |
toString(char delimiter)
Returns a string representation of the path, separating components with the given delimiter. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final CategoryPath EMPTY
CategoryPath
public final String[] components
CategoryPath
. Note that this array may be
shared with other CategoryPath
instances, e.g. as a result of
subpath(int)
, therefore you should traverse the array up to
length
for this path's components.
public final int length
CategoryPath
.
Constructor Detail |
---|
public CategoryPath(String... components)
public CategoryPath(String pathString, char delimiter)
delimiter
.
Method Detail |
---|
public int fullPathLength()
copyFullPath(char[], int, char)
.
public int compareTo(CategoryPath other)
CategoryPath
for lexicographic
order.
compareTo
in interface Comparable<CategoryPath>
public int copyFullPath(char[] buf, int start, char delimiter)
char[]
, starting at index
start
. delimiter
is copied between the path components.
Returns the number of chars copied.
NOTE: this method relies on the array being large enough to hold the
components and separators - the amount of needed space can be calculated
with fullPathLength()
.
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public long longHashCode()
public CategoryPath subpath(int length)
length
components.
public String toString()
toString
in class Object
toString(char)
public String toString(char delimiter)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |