Class CategoryPath
Holds a sequence of string components, specifying the hierarchical name of a category.
Note
This API is experimental and might change in incompatible ways in the next release.
Implements
Inherited Members
Namespace: Lucene.Net.Facet.Taxonomy
Assembly: Lucene.Net.Facet.dll
Syntax
public class CategoryPath : IComparable<CategoryPath>
  Constructors
CategoryPath(string, char)
Construct from a given path, separating path components with delimiter.
Declaration
public CategoryPath(string pathString, char delimiter)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | pathString | |
| char | delimiter | 
CategoryPath(params string[])
Construct from the given path components.
Declaration
public CategoryPath(params string[] components)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string[] | components | 
Fields
EMPTY
An empty CategoryPath
Declaration
public static readonly CategoryPath EMPTY
  Field Value
| Type | Description | 
|---|---|
| CategoryPath | 
Properties
Components
The components of this 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.
Declaration
public string[] Components { get; }
  Property Value
| Type | Description | 
|---|---|
| string[] | 
FullPathLength
Returns the number of characters needed to represent the path, including delimiter characters, for using with CopyFullPath(char[], int, char).
Declaration
public virtual int FullPathLength { get; }
  Property Value
| Type | Description | 
|---|---|
| int | 
Length
The number of components of this CategoryPath.
Declaration
public int Length { get; }
  Property Value
| Type | Description | 
|---|---|
| int | 
Methods
CompareTo(CategoryPath)
Compares this path with another CategoryPath for lexicographic order.
Declaration
public virtual int CompareTo(CategoryPath other)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CategoryPath | other | 
Returns
| Type | Description | 
|---|---|
| int | 
CopyFullPath(char[], int, char)
Copies the path components to the given 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.
Declaration
public virtual int CopyFullPath(char[] buf, int start, char delimiter)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char[] | buf | |
| int | start | |
| char | delimiter | 
Returns
| Type | Description | 
|---|---|
| int | 
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
  Parameters
| Type | Name | Description | 
|---|---|---|
| object | obj | The object to compare with the current object.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false.  | 
      
Overrides
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
  Returns
| Type | Description | 
|---|---|
| int | A hash code for the current object.  | 
      
Overrides
Int64HashCode()
Calculate a 64-bit hash function for this path.
NOTE: This was longHashCode() in LuceneDeclaration
public virtual long Int64HashCode()
  Returns
| Type | Description | 
|---|---|
| long | 
Subpath(int)
Returns a sub-path of this path up to length components.
Declaration
public virtual CategoryPath Subpath(int length)
  Parameters
| Type | Name | Description | 
|---|---|---|
| int | length | 
Returns
| Type | Description | 
|---|---|
| CategoryPath | 
ToString()
Returns a string representation of the path, separating components with '/'.
Declaration
public override string ToString()
  Returns
| Type | Description | 
|---|---|
| string | 
Overrides
See Also
ToString(char)
Returns a string representation of the path, separating components with the given delimiter.
Declaration
public virtual string ToString(char delimiter)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | delimiter | 
Returns
| Type | Description | 
|---|---|
| string | 
Operators
operator ==(CategoryPath, CategoryPath)
Holds a sequence of string components, specifying the hierarchical name of a category.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public static bool operator ==(CategoryPath left, CategoryPath right)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CategoryPath | left | |
| CategoryPath | right | 
Returns
| Type | Description | 
|---|---|
| bool | 
operator >(CategoryPath, CategoryPath)
Holds a sequence of string components, specifying the hierarchical name of a category.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public static bool operator >(CategoryPath left, CategoryPath right)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CategoryPath | left | |
| CategoryPath | right | 
Returns
| Type | Description | 
|---|---|
| bool | 
operator >=(CategoryPath, CategoryPath)
Holds a sequence of string components, specifying the hierarchical name of a category.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public static bool operator >=(CategoryPath left, CategoryPath right)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CategoryPath | left | |
| CategoryPath | right | 
Returns
| Type | Description | 
|---|---|
| bool | 
operator !=(CategoryPath, CategoryPath)
Holds a sequence of string components, specifying the hierarchical name of a category.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public static bool operator !=(CategoryPath left, CategoryPath right)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CategoryPath | left | |
| CategoryPath | right | 
Returns
| Type | Description | 
|---|---|
| bool | 
operator <(CategoryPath, CategoryPath)
Holds a sequence of string components, specifying the hierarchical name of a category.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public static bool operator <(CategoryPath left, CategoryPath right)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CategoryPath | left | |
| CategoryPath | right | 
Returns
| Type | Description | 
|---|---|
| bool | 
operator <=(CategoryPath, CategoryPath)
Holds a sequence of string components, specifying the hierarchical name of a category.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public static bool operator <=(CategoryPath left, CategoryPath right)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CategoryPath | left | |
| CategoryPath | right | 
Returns
| Type | Description | 
|---|---|
| bool |