Package com.sun.msv.grammar.util
Class NameClassComparator
- java.lang.Object
-
- com.sun.msv.grammar.util.NameClassComparator
-
- All Implemented Interfaces:
NameClassVisitor
- Direct Known Subclasses:
NameClassCollisionChecker
public abstract class NameClassComparator extends java.lang.Object implements NameClassVisitor
Abstract implementation of a functionNameClass x NameClass -> boolean
Override the probe method to define the actual function.To compute, create an instance and call the check method. This class is not reentrant, so the caller is responsible not to reuse the same object by multiple threads.
-
-
Constructor Summary
Constructors Constructor Description NameClassComparator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancheck(NameClass _new, NameClass _old)Returns true if two name classes collide.java.lang.ObjectonAnyName(AnyNameClass nc)java.lang.ObjectonChoice(ChoiceNameClass nc)java.lang.ObjectonDifference(DifferenceNameClass nc)java.lang.ObjectonNot(NotNameClass nc)java.lang.ObjectonNsName(NamespaceNameClass nc)java.lang.ObjectonSimple(SimpleNameClass nc)protected abstract voidprobe(java.lang.String uri, java.lang.String local)Throweurekato return true from the probe method.
-
-
-
Field Detail
-
nc1
protected NameClass nc1
Two name classes to be tested.
-
nc2
protected NameClass nc2
Two name classes to be tested.
-
eureka
protected final java.lang.RuntimeException eureka
This exception will be thrown when a collision is found.
-
MAGIC
private final java.lang.String MAGIC
- See Also:
- Constant Field Values
-
-
Method Detail
-
check
public boolean check(NameClass _new, NameClass _old)
Returns true if two name classes collide.
-
probe
protected abstract void probe(java.lang.String uri, java.lang.String local)Throweurekato return true from the probe method.
-
onAnyName
public java.lang.Object onAnyName(AnyNameClass nc)
- Specified by:
onAnyNamein interfaceNameClassVisitor
-
onNsName
public java.lang.Object onNsName(NamespaceNameClass nc)
- Specified by:
onNsNamein interfaceNameClassVisitor
-
onSimple
public java.lang.Object onSimple(SimpleNameClass nc)
- Specified by:
onSimplein interfaceNameClassVisitor
-
onNot
public java.lang.Object onNot(NotNameClass nc)
- Specified by:
onNotin interfaceNameClassVisitor
-
onDifference
public java.lang.Object onDifference(DifferenceNameClass nc)
- Specified by:
onDifferencein interfaceNameClassVisitor
-
onChoice
public java.lang.Object onChoice(ChoiceNameClass nc)
- Specified by:
onChoicein interfaceNameClassVisitor
-
-