- java.lang.Object
-
- com.pervasive.datarush.tokens.record.RecordMap.Builder
-
- All Implemented Interfaces:
TokenAppendable
- Enclosing class:
- RecordMap
public static class RecordMap.Builder extends Object implements TokenAppendable
Factory for creating record maps. The expected usage is to construct the contents using methods fromTokenAppendable
. A final call to {build()
performs the sorting and indexing.
-
-
Constructor Summary
Constructors Constructor Description Builder(RecordTokenType inputType, String[] keyFieldNames, int initialCapacity)
Create a new record map builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(TokenSequence data)
Appends all tokens in the specified sequence to this sequence.void
append(TokenSequence data, int start, int length)
Appends a subsequence of tokens in the specified sequence to this sequence.void
append(TokenValued value)
Appends the specified token value to this sequence.void
append(TokenValued value, long count)
Appends the specified token value to this sequence multiple times.RecordMap
build()
Creates the RecordMap.
-
-
-
Constructor Detail
-
Builder
public Builder(RecordTokenType inputType, String[] keyFieldNames, int initialCapacity)
Create a new record map builder.- Parameters:
inputType
- the type of the data sourcekeyFieldNames
- names of fields within the data source to use as keys for index creationinitialCapacity
- the initial capacity of the cache
-
-
Method Detail
-
append
public void append(TokenValued value)
Description copied from interface:TokenAppendable
Appends the specified token value to this sequence.The data types of the sequence and the value must be compatible. If the types are not identical, appropriate coercion will be attempted.
- Specified by:
append
in interfaceTokenAppendable
- Parameters:
value
- the token value to append
-
append
public void append(TokenValued value, long count)
Description copied from interface:TokenAppendable
Appends the specified token value to this sequence multiple times.The data types of the sequence and the value must be compatible. If the types are not identical, appropriate coercion will be attempted.
- Specified by:
append
in interfaceTokenAppendable
- Parameters:
value
- the token value to appendcount
- the number of copies to append
-
append
public void append(TokenSequence data)
Description copied from interface:TokenAppendable
Appends all tokens in the specified sequence to this sequence.The data types of the sequences must be compatible. If not identical, appropriate coercion will be attempted.
- Specified by:
append
in interfaceTokenAppendable
- Parameters:
data
- the sequence to append
-
append
public void append(TokenSequence data, int start, int length)
Description copied from interface:TokenAppendable
Appends a subsequence of tokens in the specified sequence to this sequence.The data types of the sequences must be compatible. If not identical, appropriate coercion will be attempted.
- Specified by:
append
in interfaceTokenAppendable
- Parameters:
data
- the sequence containing tokens to appendstart
- the starting index of the subsequence in the sourcelength
- the length of the subsequence
-
build
public RecordMap build()
Creates the RecordMap. Note that as a side effect of this call, the state of the builder is reset; subsequent calls toappend
will begin constructing a new map.- Returns:
- a newly created record map.
-
-