KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > kawa > xml > SelfAxis


1 // Copyright (c) 2003 Per M.A. Bothner.
2
// This is free software; for terms and warranty disclaimer see ./COPYING.
3

4 package gnu.kawa.xml;
5 import gnu.lists.*;
6
7 /** Used to implement a self:: step in a path expression. */
8
9 public class SelfAxis extends TreeScanner
10 {
11   public static SelfAxis make (NodePredicate type)
12   {
13     SelfAxis axis = new SelfAxis();
14     axis.type = type;
15     return axis;
16   }
17
18   public void scan (AbstractSequence seq, int ipos, PositionConsumer out)
19   {
20     if (type.isInstancePos(seq, ipos))
21       out.writePosition(seq, ipos);
22   }
23 }
24
Popular Tags