001: /*
002: * Copyright (c) 1998 - 2005 Versant Corporation
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * Versant Corporation - initial API and implementation
010: */
011: package com.versant.core.jdo.query;
012:
013: /**
014: * This is the common interface for a visitor.
015: * Subclasses can apply different behavior for different nodes.
016: */
017: public interface NodeVisitor {
018:
019: Object visitLiteralNode(LiteralNode node, Object[] results);
020:
021: Object visitAddNode(AddNode node, Object[] results);
022:
023: Object visitMultiplyNode(MultiplyNode node, Object[] results);
024:
025: Object visitUnaryNode(UnaryNode node, Object[] results);
026:
027: Object visitUnaryOpNode(UnaryOpNode node, Object[] results);
028:
029: Object visitNotEqualNode(NotEqualNode node, Object[] results);
030:
031: Object visitEqualNode(EqualNode node, Object[] results);
032:
033: Object visitLikeNode(LikeNode node, Object[] results);
034:
035: Object visitCompareOpNode(CompareOpNode node, Object[] results);
036:
037: Object visitParamNode(ParamNode node, Object[] results);
038:
039: Object visitFieldNode(FieldNode node, Object[] results);
040:
041: Object visitFieldNavNode(FieldNavNode node, Object[] results);
042:
043: Object visitVarNode(VarNode node, Object[] results);
044:
045: Object visitMethodNode(MethodNode node, Object[] results);
046:
047: Object visitAndNode(AndNode node, Object[] results);
048:
049: Object visitOrNode(OrNode node, Object[] results);
050:
051: Object visitOrderNode(OrderNode node, Object[] results);
052:
053: public Object visitAggregateCountStarNode(
054: AggregateCountStarNode node, Object[] results);
055:
056: public Object visitAggregateNode(AggregateNode node,
057: Object[] results);
058:
059: public Object visitAsValueNode(AsValueNode node, Object[] results);
060:
061: public Object visitGroupingNode(GroupingNode node, Object[] results);
062:
063: public Object visitResultNode(ResultNode node, Object[] results);
064:
065: public Object visitVarBindingNode(VarBindingNode node,
066: Object[] results);
067:
068: // arrive methods
069:
070: public Object arriveLiteralNode(LiteralNode node, Object msg);
071:
072: public Object arriveFieldNavNode(FieldNavNode node, Object msg);
073:
074: public Object arriveMethodNode(MethodNode node, Object msg);
075:
076: public Object arrivePrimaryExprNode(PrimaryExprNode node, Object msg);
077:
078: public Object arriveFieldNode(FieldNode node, Object msg);
079:
080: public Object arriveEqualNode(EqualNode node, Object msg);
081:
082: public Object arriveLikeNode(LikeNode node, Object msg);
083:
084: public Object arriveNotEqualNode(NotEqualNode node, Object msg);
085:
086: public Object arriveAndNode(AndNode node, Object msg);
087:
088: public Object arriveOrNode(OrNode node, Object msg);
089:
090: public Object arriveMultiplyNode(MultiplyNode node, Object msg);
091:
092: public Object arriveAddNode(AddNode node, Object msg);
093:
094: public Object arriveUnaryOpNode(UnaryOpNode node, Object msg);
095:
096: public Object arriveCompareOpNode(CompareOpNode node, Object msg);
097:
098: public Object arriveUnaryNode(UnaryNode node, Object msg);
099:
100: public Object arriveBinaryNode(BinaryNode node, Object msg);
101:
102: public Object arriveCastNode(CastNode node, Object msg);
103:
104: public Object arriveParamNode(ParamNode node, Object msg);
105:
106: public Object arriveParamNodeProxy(ParamNodeProxy node, Object msg);
107:
108: public Object arriveArgNode(ArgNode node, Object msg);
109:
110: public Object arriveArrayNode(ArrayNode node, Object msg);
111:
112: public Object arriveImportNode(ImportNode node, Object msg);
113:
114: public Object arriveLeafNode(LeafNode node, Object msg);
115:
116: public Object arriveOrderNode(OrderNode node, Object msg);
117:
118: public Object arriveVarNode(VarNode node, Object msg);
119:
120: public Object arriveVarNodeProxy(VarNodeProxy node, Object msg);
121:
122: public Object arriveReservedFieldNode(ReservedFieldNode node,
123: Object msg);
124:
125: public Object arriveAggregateCountStarNode(
126: AggregateCountStarNode node, Object msg);
127:
128: public Object arriveAggregateNode(AggregateNode node, Object msg);
129:
130: public Object arriveAsValueNode(AsValueNode node, Object msg);
131:
132: public Object arriveGroupingNode(GroupingNode node, Object msg);
133:
134: public Object arriveResultNode(ResultNode node, Object msg);
135:
136: public Object arriveVarBindingNode(VarBindingNode node, Object msg);
137:
138: }
|