35
35
*/
36
36
public class SequenceConstructor extends PathExpr {
37
37
38
- public SequenceConstructor (XQueryContext context ) {
38
+ public SequenceConstructor (final XQueryContext context ) {
39
39
super (context );
40
40
}
41
41
42
- public void analyze (AnalyzeContextInfo contextInfo ) throws XPathException {
42
+ @ Override
43
+ public void analyze (final AnalyzeContextInfo contextInfo ) throws XPathException {
43
44
contextInfo .setParent (this );
44
45
inPredicate = (contextInfo .getFlags () & IN_PREDICATE ) > 0 ;
45
46
unordered = (contextInfo .getFlags () & UNORDERED ) > 0 ;
@@ -58,20 +59,20 @@ public void analyze(AnalyzeContextInfo contextInfo) throws XPathException {
58
59
contextInfo .setStaticReturnType (staticType );
59
60
}
60
61
61
- /* (non-Javadoc)
62
- * @see org.exist.xquery.Expression#eval(org.exist.dom.persistent.DocumentSet, org.exist.xquery.value.Sequence, org.exist.xquery.value.Item)
63
- */
64
- public Sequence eval (Sequence contextSequence , Item contextItem ) throws XPathException {
62
+ @ Override
63
+ public Sequence eval (final Sequence contextSequence , final Item contextItem ) throws XPathException {
65
64
if (context .getProfiler ().isEnabled ()) {
66
65
context .getProfiler ().start (this );
67
66
context .getProfiler ().message (this , Profiler .DEPENDENCIES ,
68
67
"DEPENDENCIES" , Dependency .getDependenciesName (this .getDependencies ()));
69
- if (contextSequence != null )
70
- {context .getProfiler ().message (this , Profiler .START_SEQUENCES ,
71
- "CONTEXT SEQUENCE" , contextSequence );}
72
- if (contextItem != null )
73
- {context .getProfiler ().message (this , Profiler .START_SEQUENCES ,
74
- "CONTEXT ITEM" , contextItem .toSequence ());}
68
+ if (contextSequence != null ) {
69
+ context .getProfiler ().message (this , Profiler .START_SEQUENCES ,
70
+ "CONTEXT SEQUENCE" , contextSequence );
71
+ }
72
+ if (contextItem != null ) {
73
+ context .getProfiler ().message (this , Profiler .START_SEQUENCES ,
74
+ "CONTEXT ITEM" , contextItem .toSequence ());
75
+ }
75
76
}
76
77
final ValueSequence result = new ValueSequence ();
77
78
result .keepUnOrdered (unordered );
@@ -86,35 +87,37 @@ public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathExc
86
87
context .popDocumentContext ();
87
88
}
88
89
}
89
- if (context .getProfiler ().isEnabled ())
90
- {context .getProfiler ().end (this , "" , result );}
90
+ if (context .getProfiler ().isEnabled ()) {
91
+ context .getProfiler ().end (this , "" , result );
92
+ }
91
93
return result ;
92
94
}
93
95
94
- /* (non-Javadoc)
95
- * @see org.exist.xquery.PathExpr#dump(org.exist.xquery.util.ExpressionDumper)
96
- */
97
- public void dump (ExpressionDumper dumper ) {
96
+ @ Override
97
+ public void dump (final ExpressionDumper dumper ) {
98
98
dumper .display ("(" );
99
99
dumper .startIndent ();
100
100
boolean moreThanOne = false ;
101
101
for (final Expression step : steps ) {
102
- if (moreThanOne )
103
- {dumper .display (", " );}
102
+ if (moreThanOne ) {
103
+ dumper .display (", " );
104
+ }
104
105
moreThanOne = true ;
105
106
step .dump (dumper );
106
107
}
107
108
dumper .endIndent ();
108
109
dumper .nl ().display (")" );
109
110
}
110
111
112
+ @ Override
111
113
public String toString () {
112
114
final StringBuilder result = new StringBuilder ();
113
115
result .append ("( " );
114
116
boolean moreThanOne = false ;
115
117
for (final Expression step : steps ) {
116
- if (moreThanOne )
117
- {result .append (", " );}
118
+ if (moreThanOne ) {
119
+ result .append (", " );
120
+ }
118
121
moreThanOne = true ;
119
122
result .append (step .toString ());
120
123
}
@@ -138,9 +141,7 @@ public void addPathIfNotFunction(final PathExpr path) throws XPathException {
138
141
super .addPath (path );
139
142
}
140
143
141
- /* (non-Javadoc)
142
- * @see org.exist.xquery.Expression#returnsType()
143
- */
144
+ @ Override
144
145
public int returnsType () {
145
146
return Type .ITEM ;
146
147
}
@@ -155,10 +156,8 @@ public boolean allowMixedNodesInReturn() {
155
156
return true ;
156
157
}
157
158
158
- /* (non-Javadoc)
159
- * @see org.exist.xquery.AbstractExpression#resetState()
160
- */
161
- public void resetState (boolean postOptimization ) {
159
+ @ Override
160
+ public void resetState (final boolean postOptimization ) {
162
161
super .resetState (postOptimization );
163
162
}
164
163
}
0 commit comments