public class Fields
extends java.lang.Object
implements java.lang.Iterable<java.lang.String>, java.io.Serializable
Constructor and Description |
---|
Fields(java.util.List<java.lang.String> fields) |
Fields(java.lang.String... fields) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String field)
Checks if this contains the specified name of the field
|
boolean |
equals(java.lang.Object other) |
int |
fieldIndex(java.lang.String field)
Returns the position of the specified named field.
|
java.lang.String |
get(int fieldIndex)
Gets the field at position index in the collection.
|
int |
hashCode() |
java.util.Iterator<java.lang.String> |
iterator() |
java.util.List<java.lang.Object> |
select(Fields selector,
java.util.List<java.lang.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.
|
java.util.List<java.lang.String> |
toList() |
java.lang.String |
toString() |
public Fields(java.lang.String... fields)
public Fields(java.util.List<java.lang.String> fields)
public java.util.List<java.lang.Object> select(Fields selector, java.util.List<java.lang.Object> tuple)
selector
- Fields to selecttuple
- tuple to select frompublic java.util.List<java.lang.String> toList()
public int size()
public java.lang.String get(int fieldIndex)
fieldIndex
- index of the field to returnjava.lang.IndexOutOfBoundsException
- - if the index is out of range (index < 0 || index >= size())public java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
public int fieldIndex(java.lang.String field)
field
- Named field to evaluatejava.lang.IllegalArgumentException
- - if field does not existpublic boolean contains(java.lang.String field)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object