Class BytesRefArray
A simple append only random-access BytesRef array that stores full copies of the appended bytes in a ByteBlockPool.
Note: this class is not Thread-Safe!
Inheritance
Inherited Members
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public sealed class BytesRefArray
  Constructors
| Improve this Doc View SourceBytesRefArray(Counter)
Creates a new BytesRefArray with a counter to track allocated bytes
Declaration
public BytesRefArray(Counter bytesUsed)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Counter | bytesUsed | 
Properties
| Improve this Doc View SourceLength
Returns the current size of this BytesRefArray.
NOTE: This was size() in Lucene.
Declaration
public int Length { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | The current size of this BytesRefArray  | 
      
Methods
| Improve this Doc View SourceAppend(BytesRef)
Appends a copy of the given BytesRef to this BytesRefArray.
Declaration
public int Append(BytesRef bytes)
  Parameters
| Type | Name | Description | 
|---|---|---|
| BytesRef | bytes | The bytes to append  | 
      
Returns
| Type | Description | 
|---|---|
| System.Int32 | The index of the appended bytes  | 
      
Clear()
Clears this BytesRefArray
Declaration
public void Clear()
  Get(BytesRef, Int32)
Returns the n'th element of this BytesRefArray
Declaration
public BytesRef Get(BytesRef spare, int index)
  Parameters
| Type | Name | Description | 
|---|---|---|
| BytesRef | spare | A spare BytesRef instance  | 
      
| System.Int32 | index | The elements index to retrieve  | 
      
Returns
| Type | Description | 
|---|---|
| BytesRef | The n'th element of this BytesRefArray  | 
      
GetIterator()
Sugar for GetIterator(IComparer<BytesRef>) with a null comparer
Declaration
public IBytesRefIterator GetIterator()
  Returns
| Type | Description | 
|---|---|
| IBytesRefIterator | 
GetIterator(IComparer<BytesRef>)
Returns a IBytesRefIterator with point in time semantics. The iterator provides access to all so far appended BytesRef instances.
If a non null IComparer{BytesRef} is provided the iterator will
iterate the byte values in the order specified by the comparer. Otherwise
the order is the same as the values were appended.
This is a non-destructive operation.
Declaration
public IBytesRefIterator GetIterator(IComparer<BytesRef> comp)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Collections.Generic.IComparer<BytesRef> | comp | 
Returns
| Type | Description | 
|---|---|
| IBytesRefIterator |