public class Fields extends Object implements Iterable<String>, Serializable
Collection of unique named fields using in an ITuple.
Constructor and Description |
---|
Fields(List<String> fields) |
Fields(String... fields) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String field)
Check contains.
|
boolean |
equals(Object other) |
int |
fieldIndex(String field)
Returns the position of the specified named field.
|
String |
get(int index)
Gets the field at position index in the collection.
|
int |
hashCode() |
Iterator<String> |
iterator() |
List<Object> |
select(Fields selector,
List<Object> tuple)
Select values out of tuple given a Fields selector Note that this function can throw a NullPointerException if the fields in selector are not found in the index.
|
int |
size()
Returns the number of fields in this collection.
|
List<String> |
toList() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public List<Object> select(Fields selector, List<Object> tuple)
Select values out of tuple given a Fields selector Note that this function can throw a NullPointerException if the fields in selector are not found in the index.
selector
- Fields to selecttuple
- tuple to select frompublic int size()
Returns the number of fields in this collection.
public String get(int index)
Gets the field at position index in the collection.
index
- index of the field to returnIndexOutOfBoundsException
- public int fieldIndex(String field)
Returns the position of the specified named field.
field
- Named field to evaluateIllegalArgumentException
- public boolean contains(String field)
Check contains.
Copyright © 2022 The Apache Software Foundation. All rights reserved.