storm.trident.tuple
Class TridentTupleView

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<Object>
          extended by storm.trident.tuple.TridentTupleView
All Implemented Interfaces:
ITuple, Iterable<Object>, Collection<Object>, List<Object>, TridentTuple

public class TridentTupleView
extends AbstractList<Object>
implements TridentTuple


Nested Class Summary
static class TridentTupleView.FreshOutputFactory
           
static class TridentTupleView.OperationOutputFactory
           
static class TridentTupleView.ProjectionFactory
           
static class TridentTupleView.RootFactory
           
 
Nested classes/interfaces inherited from interface storm.trident.tuple.TridentTuple
TridentTuple.Factory
 
Field Summary
static TridentTupleView EMPTY_TUPLE
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
TridentTupleView(clojure.lang.IPersistentVector delegates, ValuePointer[] index, Map<String,ValuePointer> fieldIndex)
           
 
Method Summary
 boolean contains(String field)
          Returns true if this tuple contains the specified name of the field.
static TridentTuple createFreshTuple(Fields fields, List<Object> values)
           
static TridentTuple createFreshTuple(Fields fields, Object... values)
           
 int fieldIndex(String field)
          Returns the position of the specified field in this tuple.
 Object get(int i)
           
 byte[] getBinary(int i)
          Returns the byte array at position i in the tuple.
 byte[] getBinaryByField(String field)
           
 Boolean getBoolean(int i)
          Returns the Boolean at position i in the tuple.
 Boolean getBooleanByField(String field)
           
 Byte getByte(int i)
          Returns the Byte at position i in the tuple.
 Byte getByteByField(String field)
           
 Double getDouble(int i)
          Returns the Double at position i in the tuple.
 Double getDoubleByField(String field)
           
 Fields getFields()
          Gets the names of the fields in this tuple.
 Float getFloat(int i)
          Returns the Float at position i in the tuple.
 Float getFloatByField(String field)
           
 Integer getInteger(int i)
          Returns the Integer at position i in the tuple.
 Integer getIntegerByField(String field)
           
 Long getLong(int i)
          Returns the Long at position i in the tuple.
 Long getLongByField(String field)
           
 Short getShort(int i)
          Returns the Short at position i in the tuple.
 Short getShortByField(String field)
           
 String getString(int i)
          Returns the String at position i in the tuple.
 String getStringByField(String field)
           
 Object getValue(int i)
          Gets the field at position i in the tuple.
 Object getValueByField(String field)
           
 List<Object> getValues()
          Gets all the values in this tuple.
 List<Object> select(Fields selector)
          Returns a subset of the tuple based on the fields selector.
 int size()
          Returns the number of fields in this tuple.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray
 

Field Detail

EMPTY_TUPLE

public static TridentTupleView EMPTY_TUPLE
Constructor Detail

TridentTupleView

public TridentTupleView(clojure.lang.IPersistentVector delegates,
                        ValuePointer[] index,
                        Map<String,ValuePointer> fieldIndex)
Method Detail

createFreshTuple

public static TridentTuple createFreshTuple(Fields fields,
                                            List<Object> values)

createFreshTuple

public static TridentTuple createFreshTuple(Fields fields,
                                            Object... values)

getValues

public List<Object> getValues()
Description copied from interface: ITuple
Gets all the values in this tuple.

Specified by:
getValues in interface ITuple

size

public int size()
Description copied from interface: ITuple
Returns the number of fields in this tuple.

Specified by:
size in interface ITuple
Specified by:
size in interface Collection<Object>
Specified by:
size in interface List<Object>
Specified by:
size in class AbstractCollection<Object>

contains

public boolean contains(String field)
Description copied from interface: ITuple
Returns true if this tuple contains the specified name of the field.

Specified by:
contains in interface ITuple

getFields

public Fields getFields()
Description copied from interface: ITuple
Gets the names of the fields in this tuple.

Specified by:
getFields in interface ITuple

fieldIndex

public int fieldIndex(String field)
Description copied from interface: ITuple
Returns the position of the specified field in this tuple.

Specified by:
fieldIndex in interface ITuple

select

public List<Object> select(Fields selector)
Description copied from interface: ITuple
Returns a subset of the tuple based on the fields selector.

Specified by:
select in interface ITuple

get

public Object get(int i)
Specified by:
get in interface List<Object>
Specified by:
get in class AbstractList<Object>

getValue

public Object getValue(int i)
Description copied from interface: ITuple
Gets the field at position i in the tuple. Returns object since tuples are dynamically typed.

Specified by:
getValue in interface ITuple

getString

public String getString(int i)
Description copied from interface: ITuple
Returns the String at position i in the tuple. If that field is not a String, you will get a runtime error.

Specified by:
getString in interface ITuple

getInteger

public Integer getInteger(int i)
Description copied from interface: ITuple
Returns the Integer at position i in the tuple. If that field is not an Integer, you will get a runtime error.

Specified by:
getInteger in interface ITuple

getLong

public Long getLong(int i)
Description copied from interface: ITuple
Returns the Long at position i in the tuple. If that field is not a Long, you will get a runtime error.

Specified by:
getLong in interface ITuple

getBoolean

public Boolean getBoolean(int i)
Description copied from interface: ITuple
Returns the Boolean at position i in the tuple. If that field is not a Boolean, you will get a runtime error.

Specified by:
getBoolean in interface ITuple

getShort

public Short getShort(int i)
Description copied from interface: ITuple
Returns the Short at position i in the tuple. If that field is not a Short, you will get a runtime error.

Specified by:
getShort in interface ITuple

getByte

public Byte getByte(int i)
Description copied from interface: ITuple
Returns the Byte at position i in the tuple. If that field is not a Byte, you will get a runtime error.

Specified by:
getByte in interface ITuple

getDouble

public Double getDouble(int i)
Description copied from interface: ITuple
Returns the Double at position i in the tuple. If that field is not a Double, you will get a runtime error.

Specified by:
getDouble in interface ITuple

getFloat

public Float getFloat(int i)
Description copied from interface: ITuple
Returns the Float at position i in the tuple. If that field is not a Float, you will get a runtime error.

Specified by:
getFloat in interface ITuple

getBinary

public byte[] getBinary(int i)
Description copied from interface: ITuple
Returns the byte array at position i in the tuple. If that field is not a byte array, you will get a runtime error.

Specified by:
getBinary in interface ITuple

getValueByField

public Object getValueByField(String field)
Specified by:
getValueByField in interface ITuple

getStringByField

public String getStringByField(String field)
Specified by:
getStringByField in interface ITuple

getIntegerByField

public Integer getIntegerByField(String field)
Specified by:
getIntegerByField in interface ITuple

getLongByField

public Long getLongByField(String field)
Specified by:
getLongByField in interface ITuple

getBooleanByField

public Boolean getBooleanByField(String field)
Specified by:
getBooleanByField in interface ITuple

getShortByField

public Short getShortByField(String field)
Specified by:
getShortByField in interface ITuple

getByteByField

public Byte getByteByField(String field)
Specified by:
getByteByField in interface ITuple

getDoubleByField

public Double getDoubleByField(String field)
Specified by:
getDoubleByField in interface ITuple

getFloatByField

public Float getFloatByField(String field)
Specified by:
getFloatByField in interface ITuple

getBinaryByField

public byte[] getBinaryByField(String field)
Specified by:
getBinaryByField in interface ITuple


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.