Package repast.simphony.integration
Enum DataFileElementReader
- java.lang.Object
-
- java.lang.Enum<DataFileElementReader>
-
- repast.simphony.integration.DataFileElementReader
-
- All Implemented Interfaces:
Serializable
,Comparable<DataFileElementReader>
public enum DataFileElementReader extends Enum<DataFileElementReader>
This handles the reading of elements of a data file. Each element of the enum will handle a different type of element (the element with the same tag as the enum element).- Author:
- Jerry Vos
-
-
Field Summary
Fields Modifier and Type Field Description static String
DOUBLE_PATTERN
static String
INT_PATTERN
static String
STRING_DELIMITER
String
tag
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static List<org.jdom.Element>
fakeRecord(DataFileReader parserInst, OutputBuilder<?,?> outWriter, org.jdom.Element recordElement)
static DataFileElementReader
getElementHandler(org.jdom.Element nodeToHandle)
abstract Object[]
handle(DataFileReader parserInst, OutputBuilder<?,?> outWriter, org.jdom.Element nodeToHandle)
Handles the specified node.static DataFileElementReader
valueOf(String name)
Returns the enum constant of this type with the specified name.static DataFileElementReader[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FILE_DEF
public static final DataFileElementReader FILE_DEF
Handler for FileDef tags
-
DATA
public static final DataFileElementReader DATA
Handler for data tags.
-
RECORD
public static final DataFileElementReader RECORD
Handler for record elements.
-
TABLE
public static final DataFileElementReader TABLE
-
ARRAY
public static final DataFileElementReader ARRAY
-
BRANCH
public static final DataFileElementReader BRANCH
Handler for branch elements.
-
-
Method Detail
-
values
public static DataFileElementReader[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DataFileElementReader c : DataFileElementReader.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DataFileElementReader valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getElementHandler
public static DataFileElementReader getElementHandler(org.jdom.Element nodeToHandle)
-
handle
public abstract Object[] handle(DataFileReader parserInst, OutputBuilder<?,?> outWriter, org.jdom.Element nodeToHandle) throws IOException
Handles the specified node. Any elements to be added to the data tree should be added in this method and also returned by this method.- Parameters:
parserInst
- the instance of the reader that this is working withOutputBuilder
- the writer to use for writingnodeToHandle
- the node providing data- Returns:
- any elements added to the data tree
- Throws:
IOException
- when there is an error reading
-
fakeRecord
public static List<org.jdom.Element> fakeRecord(DataFileReader parserInst, OutputBuilder<?,?> outWriter, org.jdom.Element recordElement) throws IOException
- Throws:
IOException
-
-