1 package com.icl.saxon.pattern; 2 import com.icl.saxon.om.NodeInfo; 3 import com.icl.saxon.om.NamePool; 4 import com.icl.saxon.expr.XPathException; 5 6 13 14 public class NameTest extends NodeTest { 15 16 private short nodeType; 17 private int fingerprint; 18 19 public NameTest(short nodeType, int nameCode) { 20 this.nodeType = nodeType; 21 this.fingerprint = nameCode & 0xfffff; 22 String s = " "; 23 } 25 26 29 30 public NameTest(NodeInfo node) { 31 this.nodeType = node.getNodeType(); 32 this.fingerprint = node.getFingerprint(); 33 } 34 35 38 39 public final boolean matches(NodeInfo node) { 40 return fingerprint == node.getFingerprint() && 41 nodeType == node.getNodeType(); 42 } 43 44 49 50 public boolean matches(short nodeType, int nameCode) { 51 return ((nameCode&0xfffff) == this.fingerprint && nodeType == this.nodeType); 54 } 56 57 60 61 public final double getDefaultPriority() { 62 return 0.0; 63 } 64 65 68 69 public int getFingerprint() { 70 return fingerprint; 71 } 72 73 78 79 public short getNodeType() { 80 return nodeType; 81 } 82 83 } 84 85 | Popular Tags |