Class FieldSet
- java.lang.Object
-
- org.apache.flink.api.common.operators.util.FieldSet
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<Integer>
collection
static FieldSet
EMPTY_SET
-
Constructor Summary
Constructors Modifier Constructor Description FieldSet()
Creates a new empty set of fields.FieldSet(int... fieldIDs)
Creates a set with the given fields.FieldSet(int[] fieldIDs, boolean marker)
Creates a set with the given fields.FieldSet(Integer fieldID)
Creates a set with one field.protected
FieldSet(Collection<Integer> fields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldSet
addField(Integer fieldID)
FieldSet
addFields(int... fieldIDs)
FieldSet
addFields(FieldSet set)
FieldSet
clone()
Since instances of FieldSet are strictly immutable, this method does not actually clone, but it only returns the original instance.boolean
contains(Integer columnIndex)
boolean
equals(Object obj)
protected String
getDescriptionPrefix()
protected String
getDescriptionSuffix()
int
hashCode()
boolean
isValidSubset(FieldSet set)
Checks if the given set of fields is a valid subset of this set of fields.Iterator<Integer>
iterator()
int
size()
int[]
toArray()
Transforms the field set into an array of field IDs.FieldList
toFieldList()
Turns the FieldSet into an ordered FieldList.String
toString()
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
EMPTY_SET
public static final FieldSet EMPTY_SET
-
collection
protected final Collection<Integer> collection
-
-
Constructor Detail
-
FieldSet
public FieldSet()
Creates a new empty set of fields.
-
FieldSet
public FieldSet(Integer fieldID)
Creates a set with one field.- Parameters:
fieldID
- The id of the field.
-
FieldSet
public FieldSet(int... fieldIDs)
Creates a set with the given fields.- Parameters:
fieldIDs
- The IDs of the fields.
-
FieldSet
public FieldSet(int[] fieldIDs, boolean marker)
Creates a set with the given fields.- Parameters:
fieldIDs
- The IDs of the fields.
-
FieldSet
protected FieldSet(Collection<Integer> fields)
-
-
Method Detail
-
addFields
public FieldSet addFields(int... fieldIDs)
-
contains
public boolean contains(Integer columnIndex)
-
size
public int size()
-
toFieldList
public FieldList toFieldList()
Turns the FieldSet into an ordered FieldList.- Returns:
- An ordered FieldList.
-
toArray
public int[] toArray()
Transforms the field set into an array of field IDs. Whether the IDs are ordered or unordered depends on the specific subclass of the field set.- Returns:
- An array of all contained field IDs.
-
isValidSubset
public boolean isValidSubset(FieldSet set)
Checks if the given set of fields is a valid subset of this set of fields. For unordered sets, this is the case if all of the given set's fields are also part of this field.Subclasses that describe field sets where the field order matters must override this method to implement a field ordering sensitive check.
- Parameters:
set
- The set that is a candidate subset.- Returns:
- True, if the given set is a subset of this set, false otherwise.
-
clone
public FieldSet clone()
Since instances of FieldSet are strictly immutable, this method does not actually clone, but it only returns the original instance.
-
getDescriptionPrefix
protected String getDescriptionPrefix()
-
getDescriptionSuffix
protected String getDescriptionSuffix()
-
-