|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcascading.tuple.Fields
public final class Fields
Class Fields represents the field names in a Tuple. A tuple field may be a literal String value representing a
name, or it may be a literal Integer value representing a position, where positions start at position 0.
A Fields instance may also represent a set of field names.
Tap or
BaseOperation
returns the given field names, for a set of values the size of the given Fields instance. A selector is used to select
given referenced fields from a Tuple.
For example; Fields fields = new Fields( "a", "b", "c" );Fields fields = new Fields( 1, 2, -1 );ALL, GROUP, VALUES, ARGS, RESULTS, and UNKNOWN.
The ALL Fields set is a "wildcard" that represents all the current available fields.
The GROUP Fields set represents all the fields used as grouping values in a previous Group. If there is no previous
Group in the pipe assembly, the GROUP represents all the current field names.
The VALUES Fields set represent all the fields not used as grouping fields in a previous Group.
| Field Summary | |
|---|---|
static Fields |
ALL
Field ALL represents a wildcard for all fields |
static Fields |
ARGS
Field ARGS represents all fields used as the arguments for the current operation |
static Fields |
FIRST
Field FIRST represents the first field position, 0 |
static Fields |
GROUP
Field KEYS represents all fields used as they key for the last grouping |
static Fields |
LAST
Field LAST represents the last field postition, -1 |
static Fields |
RESULTS
Field RESULTS represents all fields returned by the current operation |
static Fields |
UNKNOWN
Field UNKNOWN |
static Fields |
VALUES
Field VALUES represents all fields used as values for the last grouping |
| Constructor Summary | |
|---|---|
|
Fields(Comparable... fields)
Constructor Fields creates a new Fields instance. |
protected |
Fields(cascading.tuple.Fields.Kind kind)
Constructor Fields creates a new Fields instance. |
| Method Summary | |
|---|---|
Fields |
append(Fields fields)
Method is used for appending the given Fields instance to this instance, into a new Fields instance. |
static Fields |
asDeclaration(Fields fields)
Method asDeclaration returns a new Fields instance for use as a declarator based on the given fields value. |
int |
compareTo(Fields other)
Method compareTo compares this instance to the given Fields instance. |
int |
compareTo(Object other)
Method compareTo implements Comparable.compareTo(Object). |
boolean |
contains(Fields fields)
Method contains returns true if this instance contains the field names and positions specified in the given fields instance. |
boolean |
equals(Object object)
|
static Fields[] |
fields(Fields... fields)
Method fields is a convenience method to create an array of Fields instances. |
Comparable |
get(int i)
Method get returns the field name or position at the given index i. |
int[] |
getPos()
Method getPos returns the pos array of this Fields object. |
int |
getPos(Comparable field)
Method getPos returns the index of the give field value in this Fields instance. |
int |
hashCode()
|
boolean |
isAll()
Method isAll returns true if this instance is the ALL field set. |
boolean |
isArgSelector()
Method isArgSelector returns true if this instance is 'defined' or the field set ALL, GROUP, or
VALUES. |
boolean |
isArguments()
Method isArguments returns true if this instance is the ARGS field set. |
boolean |
isDeclarator()
Method isDeclarator returns true if this can be used as a declarator. |
boolean |
isDefined()
Method isDefined returns true if this instance is not a field set like ALL or UNKNOWN. |
boolean |
isGroup()
Method isKeys returns true if this instance is the GROUP field set. |
boolean |
isOrdered()
Method isOrdered returns true if this instance is orderd. |
boolean |
isOutSelector()
Method isOutSelector returns true if this instance is 'defined', or the field set ALL or RESULTS. |
boolean |
isResults()
Method isResults returns true if this instance is the RESULTS field set. |
boolean |
isSubstitution()
Method isSubstitution returns true if this instance is a substitution fields set. |
boolean |
isUnknown()
Method isUnknown returns true if this instance is the UNKNOWN field set. |
boolean |
isUnOrdered()
Method isUnOrdered returns true if this instance is unordered. |
boolean |
isValues()
Method isValues returns true if this instance is the VALUES field set. |
Iterator |
iterator()
Method iterator return an unmodifiable iterator of field values. |
static Fields |
join(Fields... fields)
Method join joins all given Fields instances into a new Fields instance. |
Fields |
minus(Fields fields)
Method minus returns the difference between this instance and the given fields instance. |
static Fields |
offsetSelector(int size,
int startPos)
Method offsetSelector is a factory that makes new instances of Fields the given size but offset by startPos. |
String |
print()
Method print returns a String representation of this instance. |
static Fields |
resolve(Fields selector,
Fields... fields)
Method resolve returns a new selector expanded on the given field declarations |
Fields |
select(Fields selector)
Method select returns a new Fields instance with fields specified by the given selector. |
int |
size()
Method size returns the number of field positions in this instance. |
static Fields |
size(int size)
Method size is a factory that makes new instances of Fields the given size. |
String |
toString()
|
void |
verifyContains(Fields fields)
Method verifyContains tests if this instance contains the field names and positions specified in the given fields instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Fields UNKNOWN
public static final Fields ALL
public static final Fields GROUP
public static final Fields VALUES
public static final Fields ARGS
public static final Fields RESULTS
public static final Fields FIRST
public static final Fields LAST
| Constructor Detail |
|---|
protected Fields(cascading.tuple.Fields.Kind kind)
kind - of type Kindpublic Fields(Comparable... fields)
fields - of type Comparable...| Method Detail |
|---|
public static Fields[] fields(Fields... fields)
fields - of type Fields
public static Fields size(int size)
size - of type int
public static Fields join(Fields... fields)
fields - of type Fields
public static Fields offsetSelector(int size,
int startPos)
size - of type intstartPos - of type int
public static Fields resolve(Fields selector,
Fields... fields)
selector - of type Fieldsfields - of type Fields
public static Fields asDeclaration(Fields fields)
fields - of type Fields
public boolean isUnOrdered()
public boolean isOrdered()
public boolean isDefined()
ALL or UNKNOWN.
public boolean isOutSelector()
ALL or RESULTS.
public boolean isArgSelector()
ALL, GROUP, or
VALUES.
public boolean isDeclarator()
UNKNOWN, ALL, ARGS, GROUP, or VALUES.
public boolean isAll()
ALL field set.
public boolean isUnknown()
UNKNOWN field set.
public boolean isArguments()
ARGS field set.
public boolean isValues()
VALUES field set.
public boolean isResults()
RESULTS field set.
public boolean isGroup()
GROUP field set.
public boolean isSubstitution()
ALL, ARGS, GROUP, or VALUES.
public final Comparable get(int i)
i - is of type int
public int[] getPos()
public int getPos(Comparable field)
field - of type Comparable
public Iterator iterator()
isSubstitution() returns true,
this iterator will be empty.
iterator in interface Iterablepublic Fields select(Fields selector)
selector - of type Fields
public Fields minus(Fields fields)
fields - of type Fields
public Fields append(Fields fields)
fields - of type Fields
public void verifyContains(Fields fields)
TupleException is thrown.
fields - of type Fields
TupleException - when one or more fields are not contained in this instance.public boolean contains(Fields fields)
fields - of type Fields
public int compareTo(Fields other)
other - of type Fields
public int compareTo(Object other)
Comparable.compareTo(Object).
compareTo in interface Comparableother - of type Object
public String print()
public String toString()
toString in class Objectpublic final int size()
public boolean equals(Object object)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||