net.sf.xmlmatcher.strategy
Class AngleMatchingStrategy
java.lang.Object
net.sf.xmlmatcher.strategy.TextValueMatchingStrategy
net.sf.xmlmatcher.strategy.FloatingNumbersMatchingStrategy
net.sf.xmlmatcher.strategy.AngleMatchingStrategy
- All Implemented Interfaces:
- MatchingStrategy
public final class AngleMatchingStrategy
- extends FloatingNumbersMatchingStrategy
Compares two angle values (of type double) specified by two elements using given tolerance and period.
Field Summary |
static java.lang.String |
KEY_ATTR
|
Method Summary |
static double |
delta(double angle1,
double angle2,
double period)
|
protected void |
matchTextContent(org.w3c.dom.Element template,
org.w3c.dom.Element actual,
java.lang.String templateValue,
java.lang.String actualValue,
Matcher matcher)
|
boolean |
select(org.w3c.dom.Element template,
boolean hasChildren)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY_ATTR
public static final java.lang.String KEY_ATTR
- See Also:
- Constant Field Values
AngleMatchingStrategy
public AngleMatchingStrategy()
select
public boolean select(org.w3c.dom.Element template,
boolean hasChildren)
throws InvalidTemplateException
- Specified by:
select
in interface MatchingStrategy
- Overrides:
select
in class FloatingNumbersMatchingStrategy
- Parameters:
template
- template Element to comparehasChildren
- true if given template element has children elements
- Returns:
- true if this strategy can handle comparison of given template to some actual element
- Throws:
InvalidTemplateException
matchTextContent
protected void matchTextContent(org.w3c.dom.Element template,
org.w3c.dom.Element actual,
java.lang.String templateValue,
java.lang.String actualValue,
Matcher matcher)
throws XMLMismatchException,
InvalidTemplateException
- Overrides:
matchTextContent
in class FloatingNumbersMatchingStrategy
templateValue
- non-nullable StringactualValue
- non-nullable String
- Throws:
XMLMismatchException
InvalidTemplateException
delta
public static double delta(double angle1,
double angle2,
double period)
Copyright © 2007. All Rights Reserved.