1 package com.thaiopensource.relaxng.impl; 2 3 import com.thaiopensource.xml.util.Name; 4 5 class AnyNameExceptNameClass implements NameClass { 6 7 private final NameClass nameClass; 8 9 AnyNameExceptNameClass(NameClass nameClass) { 10 this.nameClass = nameClass; 11 } 12 13 public boolean contains(Name name) { 14 return !nameClass.contains(name); 15 } 16 17 public int containsSpecificity(Name name) { 18 return contains(name) ? SPECIFICITY_ANY_NAME : SPECIFICITY_NONE; 19 } 20 21 public boolean equals(Object obj) { 22 if (obj == null || !(obj instanceof AnyNameExceptNameClass)) 23 return false; 24 return nameClass.equals(((AnyNameExceptNameClass)obj).nameClass); 25 } 26 27 public int hashCode() { 28 return ~nameClass.hashCode(); 29 } 30 31 public void accept(NameClassVisitor visitor) { 32 visitor.visitAnyNameExcept(nameClass); 33 } 34 35 public boolean isOpen() { 36 return true; 37 } 38 } 39 | Popular Tags |