Package xml.factories.attribute
Class XmlTripleFactory<T extends Triple>
java.lang.Object
xml.factories.attribute.XmlFactoryFromAttribute<T>
xml.factories.attribute.XmlTripleFactory<T>
public class XmlTripleFactory<T extends Triple> extends XmlFactoryFromAttribute<T>
Constructs
Triple
s from XML attributes, according to the given DoubleTriFunction
.-
Constructor Summary
Constructors Constructor Description XmlTripleFactory(DoubleTriFunction<T> creator)
Construct a triple factory which will create instances of the type returned bycreator
. -
Method Summary
Methods inherited from class xml.factories.attribute.XmlFactoryFromAttribute
create, create
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
XmlTripleFactory
Construct a triple factory which will create instances of the type returned bycreator
.- Parameters:
creator
- A function which receives three doubles and returns a newTriple
.
-
-
Method Details
-
create
Constructs a newTriple
from an XML attribute string.- Specified by:
create
in classXmlFactoryFromAttribute<T extends Triple>
- Parameters:
attribute
- The XML attribute, in the form "x y z" where x, y, and z are doubles.- Returns:
- A new triple with the given coordinates.
- Throws:
XmlParserException
- if the input string was malformed.
-