01: package com.rimfaxe.xml.xmlreader.xpath;
02:
03: /** Test position within element list.
04:
05: <blockquote><small> Copyright (C) 2002 Hewlett-Packard Company.
06: This file is part of Sparta, an XML Parser, DOM, and XPath library.
07: This library is free software; you can redistribute it and/or
08: modify it under the terms of the <a href="doc-files/LGPL.txt">GNU
09: Lesser General Public License</a> as published by the Free Software
10: Foundation; either version 2.1 of the License, or (at your option)
11: any later version. This library is distributed in the hope that it
12: will be useful, but WITHOUT ANY WARRANTY; without even the implied
13: warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14: PURPOSE. </small></blockquote>
15: @version $Date: 2002/12/13 18:08:30 $ $Revision: 1.3 $
16: @author Eamonn O'Brien-Strain
17: */
18:
19: public class PositionEqualsExpr extends BooleanExpr {
20:
21: public PositionEqualsExpr(int position) {
22: position_ = position;
23: }
24:
25: public void accept(BooleanExprVisitor visitor)
26: throws XPathException {
27: visitor.visit(this );
28: }
29:
30: public int getPosition() {
31: return position_;
32: }
33:
34: public String toString() {
35: return "[" + position_ + "]";
36: }
37:
38: private final int position_;
39: }
40:
41: // $Log: PositionEqualsExpr.java,v $
42: // Revision 1.3 2002/12/13 18:08:30 eobrain
43: // Factor Visitor out into separate visitors for node tests and predicates.
44: //
45: // Revision 1.2 2002/12/06 23:41:49 eobrain
46: // Add toString() which returns the original XPath.
47: //
48: // Revision 1.1 2002/09/18 05:22:06 eobrain
49: // Support xpath predicates of the for [1], [2], ...
50: //
|