public final class RecordValuedFilter extends Object implements RecordValued
RecordValued
.
This API should be considered evolving; backwards compatibility is not guaranteed in future releases.
Constructor and Description |
---|
RecordValuedFilter(RecordTokenType targetType,
Map<String,String> targetToSourceNameMapping,
RecordValued source)
Defines a
RecordValued object, declaring the specified
type, backed by the underlying source. |
RecordValuedFilter(RecordTokenType targetType,
Map<String,String> targetToSourceNameMapping,
RecordValued source,
ModificationCountProvider modificationCountProvider)
Defines a
RecordValued object, declaring the specified
type, backed by the underlying source. |
RecordValuedFilter(RecordTokenType targetType,
RecordValued source)
Defines a
RecordValued object, declaring the specified
type, backed by the underlying source. |
RecordValuedFilter(RecordTokenType targetType,
RecordValued source,
ModificationCountProvider modificationCountProvider)
Defines a
RecordValued object, declaring the specified
type, backed by the underlying source. |
Modifier and Type | Method and Description |
---|---|
boolean |
containsNull()
Determines if any field in the record is null valued.
|
ScalarValued |
getField(int index)
Get the field at the given index within the list of fields.
|
ScalarValued |
getField(String fieldName)
Gets the value of the field with the given name.
|
ScalarValued[] |
getFields()
Gets the values of all fields in the record
|
RecordTokenType |
getType()
Gets the data type of the token.
|
boolean |
isNull()
Indicates whether the token is null valued.
|
ScalarValuedIterator |
newFieldIterator(FieldIteratorProperties properties)
Create a new iterator for visiting the fields in this RecordValued object.
|
ScalarValuedIterator |
newFieldIterator(ScalarTokenType type)
Create a new iterator for visiting the fields in this RecordValued object.
|
ScalarValuedIterator |
newFieldIterator(ScalarTokenType type,
String[] selectedFieldNames)
Create a new iterator for visiting the fields in this RecordValued object.
|
int |
size()
Gets the number of fields in the record schema.
|
public RecordValuedFilter(RecordTokenType targetType, RecordValued source)
RecordValued
object, declaring the specified
type, backed by the underlying source. The fields consist of a subset
of those of the source.
It is assumed that the source is immutable; if this is not the
case, field iterators obtained from this object may not behave
correctly. Use RecordValuedFilter(RecordTokenType, RecordValued, ModificationCountProvider)
with an appropriate modification counter instead if this is
an issue.
targetType
- The record type that we expose as our external type.
All the fields in the target type must be present in the source type.source
- The backing record objectpublic RecordValuedFilter(RecordTokenType targetType, RecordValued source, ModificationCountProvider modificationCountProvider)
RecordValued
object, declaring the specified
type, backed by the underlying source. The fields consist of a subset
of those of the source.targetType
- The record type that we expose as our external type.
All the fields in the target type must be present in the source type.source
- The backing record objectmodificationCountProvider
- a counter which reflects modifications
to the underlying source. This is required to ensure field iterators
remain consistent.public RecordValuedFilter(RecordTokenType targetType, Map<String,String> targetToSourceNameMapping, RecordValued source)
RecordValued
object, declaring the specified
type, backed by the underlying source. Fields in the result
are mapped from the source as specified.
It is assumed that the source is immutable; if this is not the
case, field iterators obtained from this object may not behave
correctly. Use RecordValuedFilter(RecordTokenType, Map, RecordValued, ModificationCountProvider)
with an appropriate modification counter instead if this is
an issue.
targetType
- The record type that we expose as our external type.targetToSourceNameMapping
- Mapping between field names of the external
type and those of the source type. Every target type field must be specified within
the map. It is valid for more than one target field to map to a given source field.source
- The backing record object.public RecordValuedFilter(RecordTokenType targetType, Map<String,String> targetToSourceNameMapping, RecordValued source, ModificationCountProvider modificationCountProvider)
RecordValued
object, declaring the specified
type, backed by the underlying source. Fields in the result
are mapped from the source as specified.targetType
- The record type that we expose as our external type.targetToSourceNameMapping
- Mapping between field names of the external
type and those of the source type. Every target type field must be specified within
the map. It is valid for more than one target field to map to a given source field.source
- The backing record object.modificationCountProvider
- a counter which reflects modifications
to the underlying source. This is required to ensure field iterators
remain consistent.public boolean isNull()
TokenValued
isNull
in interface TokenValued
true
if the token is null valued,
false
otherwisepublic boolean containsNull()
RecordValued
containsNull
in interface RecordValued
true
if at least one field is null
valued, false
if none arepublic ScalarValued getField(String fieldName)
RecordValued
getField
in interface RecordValued
fieldName
- the field namepublic ScalarValued getField(int index)
RecordValued
getField
in interface RecordValued
index
- zero-based index into the field listpublic ScalarValued[] getFields()
RecordValued
getFields
in interface RecordValued
public RecordTokenType getType()
TokenValued
getType
in interface RecordValued
getType
in interface TokenValued
getType
in interface RecordTyped
getType
in interface TokenTyped
public ScalarValuedIterator newFieldIterator(ScalarTokenType type)
RecordValued
newFieldIterator
in interface RecordValued
type
- the type of fields over which to iteratepublic ScalarValuedIterator newFieldIterator(ScalarTokenType type, String[] selectedFieldNames)
RecordValued
newFieldIterator
in interface RecordValued
type
- the type of fields over which to iterateselectedFieldNames
- the fields over which to iteratepublic ScalarValuedIterator newFieldIterator(FieldIteratorProperties properties)
RecordValued
FieldIteratorProperties.isSorted()
.newFieldIterator
in interface RecordValued
properties
- properties for the iteratorpublic int size()
RecordValued
size
in interface RecordValued
Copyright © 2015 Actian Corporation. All Rights Reserved.