//--------------------------------------\r
// XerialJ\r
//\r
-// Node.java\r
-// Since: Aug 6, 2009 1:22:15 PM\r
+// RelationAttribute.java\r
+// Since: Oct 13, 2009 12:21:23 PM\r
//\r
// $URL$\r
// $Author$\r
//--------------------------------------\r
package org.xerial.lens.relation.query.lang;\r
\r
-import org.xerial.lens.relation.TupleIndex;\r
+import org.xerial.lens.relation.NodeBase;\r
\r
-/**\r
- * base class of relation expression\r
- * \r
- * @author leo\r
- * \r
- */\r
-public abstract class RelationItem {\r
- public String name;\r
- public String alias;\r
+public class RelationAttribute extends NodeBase<RelationAttribute> {\r
\r
- protected TupleIndex index = TupleIndex.root();\r
-\r
- public void setIndex(String tupleIndex) {\r
- index = TupleIndex.parse(tupleIndex);\r
+ public static class Compare {\r
+ public String operator;\r
+ public String operand;\r
}\r
\r
- public TupleIndex getIndex() {\r
- return index;\r
+ public static class PatternMatch {\r
+ public String operand;\r
}\r
\r
- public abstract boolean isRelation();\r
+ public String name;\r
+ public String alias;\r
+ public String nodeValue;\r
+ public Compare compare;\r
+ public PatternMatch patternMatch;\r
+\r
+ @Override\r
+ public String toString() {\r
+ return String.format("%s%s%s", name, alias != null ? " as " + alias : "",\r
+ nodeValue != null ? ":" + nodeValue : "");\r
+ }\r
\r
}\r