cascading.tuple
Class TupleEntry

java.lang.Object
  extended by cascading.tuple.TupleEntry

public class TupleEntry
extends Object

Class TupleEntry allows a Tuple instance and its declarating Fields instance to be used as a single object.

Once a TupleEntry is created, its Fields cannot be changed, but the Tuple instance it holds can be replaced, or modified. The managed Tuple should not have elements added or removed, as this will break the relationship with the associated Fields instance.

See Also:
Fields, Tuple

Constructor Summary
TupleEntry()
          Constructor TupleEntry creates a new TupleEntry instance.
TupleEntry(boolean isUnmodifiable)
           
TupleEntry(Fields fields)
          Constructor TupleEntry creates a new TupleEntry instance.
TupleEntry(Fields fields, boolean isUnmodifiable)
           
TupleEntry(Fields fields, Tuple tuple)
          Constructor TupleEntry creates a new TupleEntry instance.
TupleEntry(Tuple tuple)
          Constructor TupleEntry creates a new TupleEntry instance.
TupleEntry(TupleEntry tupleEntry)
          Constructor TupleEntry creates a new TupleEntry instance that is a safe copy of the given tupleEntry.
 
Method Summary
 TupleEntry appendNew(TupleEntry entry)
          Method appendNew appends the given TupleEntry instance to this instance.
 Comparable get(Comparable field)
          Method get returns the value in the given field.
 Comparable get(int i)
          Method get returns the value in the given position i.
 boolean getBoolean(Comparable field)
          Method getBoolean returns the element for the given fieldname field as a boolean.
 double getDouble(Comparable field)
          Method getDouble returns the element for the given fieldname field as a double.
 Fields getFields()
          Method getFields returns the fields of this TupleEntry object.
 float getFloat(Comparable field)
          Method getFloat returns the element for the given fieldname field as a float.
 int getInteger(Comparable field)
          Method getInteger returns the element for the given fieldname field as an int.
 long getLong(Comparable field)
          Method getLong returns the element for the given fieldname field as a long.
 short getShort(Comparable field)
          Method getShort returns the element for the given fieldname field as a short.
 String getString(Comparable field)
          Method getString returns the element for the given fieldname field as a String.
 Tuple getTuple()
          Method getTuple returns the tuple of this TupleEntry object.
 boolean isUnmodifiable()
          Method isUnmodifiable returns true if this TupleEntry is unmodifiable.
static Tuple select(Fields selector, TupleEntry... entries)
          Method select will select a new Tuple instance from the given set of entries.
 TupleEntry selectEntry(Fields selector)
          Method selectEntry selects the fields specified in selector from this instance.
 Tuple selectTuple(Fields selector)
          Method selectTuple selects the fields specified in selector from this instance.
 void set(Comparable field, Comparable value)
          Method set sets the value in the given field.
 void set(TupleEntry tupleEntry)
          Method set sets the values from the given tupleEntry into this TupleEntry instance based on the given tupleEntry field names.
 void setTuple(Fields selector, Tuple tuple)
          Method setTuple sets the values specified by the selector to the values given by the given tuple.
 void setTuple(Tuple tuple)
          Method setTuple sets the tuple of this TupleEntry object.
 int size()
          Method size returns the number of values in this instance.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TupleEntry

public TupleEntry()
Constructor TupleEntry creates a new TupleEntry instance.


TupleEntry

public TupleEntry(boolean isUnmodifiable)

TupleEntry

public TupleEntry(Fields fields)
Constructor TupleEntry creates a new TupleEntry instance.

Parameters:
fields - of type Fields

TupleEntry

public TupleEntry(Fields fields,
                  boolean isUnmodifiable)

TupleEntry

public TupleEntry(Fields fields,
                  Tuple tuple)
Constructor TupleEntry creates a new TupleEntry instance.

Parameters:
fields - of type Fields
tuple - of type Tuple

TupleEntry

public TupleEntry(TupleEntry tupleEntry)
Constructor TupleEntry creates a new TupleEntry instance that is a safe copy of the given tupleEntry.

Parameters:
tupleEntry - of type TupleEntry

TupleEntry

public TupleEntry(Tuple tuple)
Constructor TupleEntry creates a new TupleEntry instance.

Parameters:
tuple - of type Tuple
Method Detail

select

public static Tuple select(Fields selector,
                           TupleEntry... entries)
Method select will select a new Tuple instance from the given set of entries. Entries order is significant to the selector.

Parameters:
selector - of type Fields
entries - of type TupleEntry
Returns:
Tuple

isUnmodifiable

public boolean isUnmodifiable()
Method isUnmodifiable returns true if this TupleEntry is unmodifiable.

Returns:
boolean

getFields

public Fields getFields()
Method getFields returns the fields of this TupleEntry object.

Returns:
the fields (type Fields) of this TupleEntry object.

getTuple

public Tuple getTuple()
Method getTuple returns the tuple of this TupleEntry object.

Returns:
the tuple (type Tuple) of this TupleEntry object.

setTuple

public void setTuple(Tuple tuple)
Method setTuple sets the tuple of this TupleEntry object.

Parameters:
tuple - the tuple of this TupleEntry object.

size

public int size()
Method size returns the number of values in this instance.

Returns:
int

get

public Comparable get(int i)
Method get returns the value in the given position i.

Parameters:
i - of type int
Returns:
Comparable

get

public Comparable get(Comparable field)
Method get returns the value in the given field.

Parameters:
field - of type Comparable
Returns:
Comparable

set

public void set(Comparable field,
                Comparable value)
Method set sets the value in the given field.

Parameters:
field - of type Comparable
value - of type Comparable

getString

public String getString(Comparable field)
Method getString returns the element for the given fieldname field as a String.

Parameters:
field - of type Comparable
Returns:
String

getFloat

public float getFloat(Comparable field)
Method getFloat returns the element for the given fieldname field as a float. Zero if null.

Parameters:
field - of type Comparable
Returns:
float

getDouble

public double getDouble(Comparable field)
Method getDouble returns the element for the given fieldname field as a double. Zero if null.

Parameters:
field - of type Comparable
Returns:
double

getInteger

public int getInteger(Comparable field)
Method getInteger returns the element for the given fieldname field as an int. Zero if null.

Parameters:
field - of type Comparable
Returns:
int

getLong

public long getLong(Comparable field)
Method getLong returns the element for the given fieldname field as a long. Zero if null.

Parameters:
field - of type Comparable
Returns:
long

getShort

public short getShort(Comparable field)
Method getShort returns the element for the given fieldname field as a short. Zero if null.

Parameters:
field - of type Comparable
Returns:
short

getBoolean

public boolean getBoolean(Comparable field)
Method getBoolean returns the element for the given fieldname field as a boolean. If the value is (case ignored) the string 'true', a true value will be returned. false if null.

Parameters:
field - of type Comparable
Returns:
boolean

selectEntry

public TupleEntry selectEntry(Fields selector)
Method selectEntry selects the fields specified in selector from this instance.

Parameters:
selector - of type Fields
Returns:
TupleEntry

selectTuple

public Tuple selectTuple(Fields selector)
Method selectTuple selects the fields specified in selector from this instance.

Parameters:
selector - of type Fields
Returns:
Tuple

setTuple

public void setTuple(Fields selector,
                     Tuple tuple)
Method setTuple sets the values specified by the selector to the values given by the given tuple.

Parameters:
selector - of type Fields
tuple - of type Tuple

set

public void set(TupleEntry tupleEntry)
Method set sets the values from the given tupleEntry into this TupleEntry instance based on the given tupleEntry field names.

Parameters:
tupleEntry - of type TupleEntry

appendNew

public TupleEntry appendNew(TupleEntry entry)
Method appendNew appends the given TupleEntry instance to this instance.

Parameters:
entry - of type TupleEntry
Returns:
TupleEntry

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2008 Concurrent, Inc. All Rights Reserved.