public class XmlOdParser extends Object implements Serializable
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
XmlOdParser(OTSSimulatorInterface simulator,
OTSRoadNetwork network,
Set<GTUType> gtuTypes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(InputStream stream)
Applies demand from stream.
|
void |
apply(InputStream stream,
ODOptions odOptions)
Applies demand from stream using OD options.
|
void |
apply(Node xmlNode)
Applies demand from xml node.
|
void |
apply(Node xmlNode,
ODOptions odOptions)
Applies demand from URL using OD options.
|
void |
apply(URL url)
Applies demand from URL.
|
void |
apply(URL url,
ODOptions odOptions)
Applies demand from URL using OD options.
|
ODMatrix |
build(InputStream stream)
Build demand from stream.
|
ODMatrix |
build(Node xmlNode)
Build demand from xml node.
|
ODMatrix |
build(URL url)
Build demand from URL.
|
GTUType |
getGTUType(String id)
Returns the GTU type for the given id.
|
public XmlOdParser(OTSSimulatorInterface simulator, OTSRoadNetwork network, Set<GTUType> gtuTypes)
simulator
- OTSSimulatorInterface; simulatornetwork
- OTSRoadNetwork; networkgtuTypes
- Set<GTUType>; set of GTU typespublic GTUType getGTUType(String id) throws XmlParserException
id
- String; idXmlParserException
- if the GTU type is not availablepublic final void apply(URL url) throws XmlParserException
url
- URL; URL to fileXmlParserException
- if URL cannot be parsedpublic void apply(URL url, ODOptions odOptions) throws XmlParserException
url
- URL; URL to fileodOptions
- ODOptions; OD optionsXmlParserException
- if URL cannot be parsedpublic final void apply(InputStream stream) throws XmlParserException
stream
- InputStream; streamXmlParserException
- if URL cannot be parsedpublic final void apply(InputStream stream, ODOptions odOptions) throws XmlParserException
stream
- InputStream; streamodOptions
- ODOptions; OD optionsXmlParserException
- if URL cannot be parsedpublic final void apply(Node xmlNode) throws XmlParserException
xmlNode
- Node; nodeXmlParserException
- if URL cannot be parsedpublic void apply(Node xmlNode, ODOptions odOptions) throws XmlParserException
xmlNode
- Node; nodeodOptions
- ODOptions; OD optionsXmlParserException
- if URL cannot be parsedpublic final ODMatrix build(URL url) throws XmlParserException
url
- URL; URL to fileXmlParserException
- if URL cannot be parsedpublic final ODMatrix build(InputStream stream) throws XmlParserException
stream
- InputStream; streamXmlParserException
- if stream cannot be parsedpublic final ODMatrix build(Node xmlNode) throws XmlParserException
xmlNode
- Node; nodeXmlParserException
- if stream cannot be parsedCopyright © 2014–2019 Delft University of Technology. All rights reserved.