1 6 7 package com.hp.hpl.jena.graph.query; 8 9 import com.hp.hpl.jena.graph.*; 10 11 18 19 public abstract class Element 20 { 21 protected int index; 22 23 26 public int getIndex() 27 { return index; } 28 29 32 protected Element( int index ) 33 { this.index = index; } 34 35 38 protected Element() 39 { this( -1 ); } 40 41 44 public static final Element ANY = new Element() 45 { 46 public boolean match( Domain d, Node n ) { return true; } 47 public Node asNodeMatch( Domain d ) { return Node.ANY; } 48 public String toString() { return "<any>"; } 49 }; 50 51 58 public abstract boolean match( Domain d, Node x ); 59 60 66 public abstract Node asNodeMatch( Domain d ); 67 68 public String toString() 69 { return "<" + this.getClass() + " element>"; } 70 } 71 72 101 | Popular Tags |