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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if two name classes collide.onNot
(NotNameClass nc) protected abstract void
Throweureka
to 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. -
MAGIC
- See Also:
-
-
Constructor Details
-
NameClassComparator
public NameClassComparator()
-
-
Method Details
-
check
Returns true if two name classes collide. -
probe
Throweureka
to return true from the probe method. -
onAnyName
- Specified by:
onAnyName
in interfaceNameClassVisitor
-
onNsName
- Specified by:
onNsName
in interfaceNameClassVisitor
-
onSimple
- Specified by:
onSimple
in interfaceNameClassVisitor
-
onNot
- Specified by:
onNot
in interfaceNameClassVisitor
-
onDifference
- Specified by:
onDifference
in interfaceNameClassVisitor
-
onChoice
- Specified by:
onChoice
in interfaceNameClassVisitor
-