public class AcePathfinderUtil extends Object
AcePathfinderUtilis a collection of static methods used to interact with the
AcePathfinder singleton.
The path, for the purposes of this class, is formated as:
a@b!c,a@b!c,...
:[
HashMap]
ArrayList]
<String,String> = <"event",c>
| Modifier and Type | Class and Description |
|---|---|
static class |
AcePathfinderUtil.PathType |
| Constructor and Description |
|---|
AcePathfinderUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getEventDateVar(String event,
String var)
Renames a date variable from an event
|
static AcePathfinder |
getInstance() |
static String |
getPathOr(HashMap<String,Object> map,
String var,
String alternatePath) |
static AcePathfinderUtil.PathType |
getVariableType(String var)
Returns the general section of this variable (weather, soil, experiment).
|
static void |
insertValue(HashMap m,
String var,
String val)
Inserts the variable in the appropriate place in a
HashMap,
according to the AcePathfinder. |
static void |
insertValue(HashMap m,
String var,
String val,
boolean eventAppendMode)
Inserts the variable in the appropriate place in a
HashMap,
according to the AcePathfinder. |
static void |
insertValue(HashMap m,
String var,
String val,
String path)
Inserts the variable in the appropriate place in a
HashMap,
according to the AcePathfinder. |
static void |
insertValue(HashMap m,
String var,
String val,
String path,
boolean eventAppendMode)
Inserts the variable in the appropriate place in a
HashMap,
according to the AcePathfinder. |
static boolean |
isDate(String var)
Returns if the variable is a date.
|
static void |
newRecord(HashMap m,
String path)
Creates a new record in a series, such as daily
weather records, soil layers, etc.
|
static String |
setEventDateVar(String var,
boolean isEvent)
Renames a date variable for an event
|
static HashMap |
traverseToPoint(HashMap m,
String p)
A helper method to help traverse to a certain point in the map.
|
public static AcePathfinder getInstance()
public static AcePathfinderUtil.PathType getVariableType(String var)
var - Variable to lookuppublic static boolean isDate(String var)
var - Variable to checkpublic static void insertValue(HashMap m, String var, String val)
HashMap,
according to the AcePathfinder.m - the HashMap to add the variable to.var - Variable to lookupval - the value to insert into the HashMappublic static void insertValue(HashMap m, String var, String val, boolean eventAppendMode)
HashMap,
according to the AcePathfinder.m - the HashMap to add the variable to.var - Variable to lookupval - the value to insert into the HashMapeventAppendMode - True for add variable into last same type event; False for add to last event without type checkpublic static void insertValue(HashMap m, String var, String val, String path)
HashMap,
according to the AcePathfinder.m - the HashMap to add the variable to.var - the variable to lookup in the AcePathfinderval - the value to insert into the HashMappath - use a custom path vs. a lookup path, useful if dealing with custom variablespublic static void insertValue(HashMap m, String var, String val, String path, boolean eventAppendMode)
HashMap,
according to the AcePathfinder.m - the HashMap to add the variable to.var - the variable to lookup in the AcePathfinderval - the value to insert into the HashMappath - use a custom path vs. a lookup path, useful if dealing with custom variableseventAppendMode - True for add variable into last same type event; False for add to last event without type checkpublic static void newRecord(HashMap m, String path)
mparameter, it will be created.
m - The HashMap to be modified.path - The path to lookup and see if a multi-line record is
supported for this field.public static HashMap traverseToPoint(HashMap m, String p)
m - Map to traversep - Path to traverse topublic static String getPathOr(HashMap<String,Object> map, String var, String alternatePath)
public static String setEventDateVar(String var, boolean isEvent)
Copyright © 2014. All Rights Reserved.