* \r
* @param <NodeType>\r
*/\r
-public abstract class NodeBase<NodeType> implements Cell<NodeType>\r
-{\r
- protected NodeBase()\r
- {}\r
+public abstract class NodeBase<NodeType> implements TupleElement<NodeType> {\r
+ protected NodeBase() {}\r
\r
- public boolean isNode()\r
- {\r
+ public boolean isNode() {\r
return true;\r
}\r
\r
- public boolean isTuple()\r
- {\r
+ public boolean isTuple() {\r
return false;\r
}\r
\r
* \r
* @return\r
*/\r
- public int size()\r
- {\r
+ public int size() {\r
return 1;\r
}\r
\r
- public Tuple<NodeType> getTuple()\r
- {\r
- throw new XerialError(XerialErrorCode.UNSUPPORTED);\r
+ public Tuple<NodeType> castToTuple() {\r
+ return null;\r
}\r
\r
- public Cell<NodeType> get(TupleIndex index)\r
- {\r
+ public TupleElement<NodeType> get(TupleIndex index) {\r
if (index.size() == 0 && index.get(0) == 0)\r
- return (Cell<NodeType>) this;\r
+ return (TupleElement<NodeType>) this;\r
else\r
throw new XerialError(XerialErrorCode.INVALID_STATE);\r
}\r
\r
@SuppressWarnings("unchecked")\r
- public NodeType getNode(TupleIndex index)\r
- {\r
+ public NodeType getElement(TupleIndex index) {\r
if (!(index.size() == 1 && index.get(0) == 0))\r
throw new XerialError(XerialErrorCode.INVALID_STATE);\r
else\r
}\r
\r
@SuppressWarnings("unchecked")\r
- public NodeType getNode()\r
- {\r
+ public NodeType castToNode() {\r
return (NodeType) this;\r
}\r
\r
@SuppressWarnings("unchecked")\r
- public void accept(CellVisitor<NodeType> visitor)\r
- {\r
+ public void accept(TupleElementVisitor<NodeType> visitor) {\r
visitor.visitNode((NodeType) this);\r
}\r
\r