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
Abstract implementation of a function
NameClass x NameClass -> booleanOverride 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.
- Author:
- Kohsuke KAWAGUCHI
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if two name classes collide.onNot(NotNameClass nc) protected abstract voidThroweurekato return true from the probe method.
-
Field Details
-
nc1
Two name classes to be tested. -
nc2
Two name classes to be tested. -
eureka
This exception will be thrown when a collision is found.
-
-
Constructor Details
-
NameClassComparator
public NameClassComparator()
-
-
Method Details
-
check
Returns true if two name classes collide. -
probe
Throweurekato return true from the probe method. -
onAnyName
- Specified by:
onAnyNamein interfaceNameClassVisitor
-
onNsName
- Specified by:
onNsNamein interfaceNameClassVisitor
-
onSimple
- Specified by:
onSimplein interfaceNameClassVisitor
-
onNot
- Specified by:
onNotin interfaceNameClassVisitor
-
onDifference
- Specified by:
onDifferencein interfaceNameClassVisitor
-
onChoice
- Specified by:
onChoicein interfaceNameClassVisitor
-