Added ITupleReference

git-svn-id: https://hyracks.googlecode.com/svn/trunk@109 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/comm/IFrameTupleAccessor.java b/hyracks/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/comm/IFrameTupleAccessor.java
index 0b4d3ff..8b82728 100644
--- a/hyracks/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/comm/IFrameTupleAccessor.java
+++ b/hyracks/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/comm/IFrameTupleAccessor.java
@@ -17,6 +17,8 @@
 import java.nio.ByteBuffer;
 
 public interface IFrameTupleAccessor {
+    public int getFieldCount();
+
     public int getFieldSlotsLength();
 
     public int getFieldEndOffset(int tupleIndex, int fIdx);
diff --git a/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/comm/io/FrameTupleAccessor.java b/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/comm/io/FrameTupleAccessor.java
index 7143cfc..e35c54b 100644
--- a/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/comm/io/FrameTupleAccessor.java
+++ b/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/comm/io/FrameTupleAccessor.java
@@ -110,4 +110,9 @@
             System.err.println("]");
         }
     }
+
+    @Override
+    public int getFieldCount() {
+        return recordDescriptor.getFields().length;
+    }
 }
\ No newline at end of file
diff --git a/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/FrameTupleReference.java b/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/FrameTupleReference.java
index 270c7aa..aa5e447 100644
--- a/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/FrameTupleReference.java
+++ b/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/FrameTupleReference.java
@@ -20,4 +20,24 @@
     public int getTupleIndex() {
         return tIndex;
     }
+
+    @Override
+    public int getFieldCount() {
+        return fta.getFieldCount();
+    }
+
+    @Override
+    public byte[] getFieldData(int fIdx) {
+        return fta.getBuffer().array();
+    }
+
+    @Override
+    public int getFieldStart(int fIdx) {
+        return fta.getFieldStartOffset(tIndex, fIdx);
+    }
+
+    @Override
+    public int getFieldLength(int fIdx) {
+        return fta.getFieldLength(tIndex, fIdx);
+    }
 }
\ No newline at end of file
diff --git a/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/IFrameTupleReference.java b/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/IFrameTupleReference.java
index 5ba5441..e681149 100644
--- a/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/IFrameTupleReference.java
+++ b/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/IFrameTupleReference.java
@@ -2,7 +2,7 @@
 
 import edu.uci.ics.hyracks.api.comm.IFrameTupleAccessor;
 
-public interface IFrameTupleReference {
+public interface IFrameTupleReference extends ITupleReference {
     public IFrameTupleAccessor getFrameTupleAccessor();
 
     public int getTupleIndex();
diff --git a/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/ITupleReference.java b/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/ITupleReference.java
new file mode 100644
index 0000000..4205724
--- /dev/null
+++ b/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/accessors/ITupleReference.java
@@ -0,0 +1,11 @@
+package edu.uci.ics.hyracks.dataflow.common.data.accessors;
+
+public interface ITupleReference {
+    public int getFieldCount();
+
+    public byte[] getFieldData(int fIdx);
+
+    public int getFieldStart(int fIdx);
+
+    public int getFieldLength(int fIdx);
+}
\ No newline at end of file