Package edu.sc.seis.sod
Class SodUtil
java.lang.Object
edu.sc.seis.sod.SodUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final edu.iris.Fissures.model.UnitImpl[]
static org.python.util.PythonInterpreter
static final edu.iris.Fissures.model.UnitImpl[]
static int
static final edu.iris.Fissures.model.UnitImpl[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
copyStream
(InputStream src, String dest) static Calendar
createCalendar
(int year, int month, int day, int hour, int minute, int second, boolean ceiling) Creates a calendar in the given year.static String
static void
fillInField
(int field, int value, boolean ceiling, Calendar cal) static String
getAbsolutePath
(String baseLoc, String relativeLoc) getAllElements
(Element config, String elementName) returns all the element with the given namestatic MicroSecondDateSupplier
getEarlierSupplier
(edu.iris.Fissures.model.TimeInterval duration) static Element
getElement
(Element config, String elementName) returns the first element with the given name, null if none exists.static Element
getFirstEmbeddedElement
(Element config) protected static String
getJythonAcceptArgs
(Class mustImplement) static MicroSecondDateSupplier
getLaterSupplier
(edu.iris.Fissures.model.TimeInterval duration) static String
getNestedText
(Element config) returns the nested text in the tag *static org.python.util.PythonInterpreter
static String
getRelativePath
(String fromPath, String toPath, String separator) static String
static String
returns the first text child within the node.protected static Object
inlineJython
(String className, Class mustImplement, String jythonCode) static int[]
intArrayFromList
(List list) static boolean
static boolean
isTrueText
(String nestedText) void
static Object
static Object
static Object
static edu.iris.Fissures.model.BoxAreaImpl
loadBoxArea
(Element config) static Dimension
loadDimensions
(Element element) static Object
loadExternal
(String tagName, String[] armNames, Element config) loads the class named in the element "classname" in config with config as a costructor argument.static float
static int
static Object
loadJython
(String tagName, String[] armNames, Element config) static void
loadProperties
(Element config, Properties props) static edu.iris.Fissures.model.QuantityImpl
loadQuantity
(Element config) static String
static MicroSecondDateSupplier
static MicroSecondDateSupplier
static edu.iris.Fissures.model.TimeInterval
loadTimeInterval
(Element config) static MicroSecondTimeRangeSupplier
loadTimeRange
(Element config) static edu.iris.Fissures.model.UnitImpl
static edu.iris.Fissures.model.UnitRangeImpl
loadUnitRange
(Element config) static File
makeOutputDirectory
(Element config) static String
nodeValueOfXPath
(Element el, String xpath) static MicroSecondDateSupplier
-
Field Details
-
interpreter
public static org.python.util.PythonInterpreter interpreter -
pythonClassNum
public static int pythonClassNum -
LENGTH_UNITS
public static final edu.iris.Fissures.model.UnitImpl[] LENGTH_UNITS -
TIME_UNITS
public static final edu.iris.Fissures.model.UnitImpl[] TIME_UNITS -
FREQ_UNITS
public static final edu.iris.Fissures.model.UnitImpl[] FREQ_UNITS
-
-
Constructor Details
-
SodUtil
public SodUtil()
-
-
Method Details
-
isTrue
-
isTrueText
-
makeOutputDirectory
- Throws:
ConfigurationException
-
load
- Throws:
ConfigurationException
-
load
- Throws:
ConfigurationException
-
load
- Throws:
ConfigurationException
-
elementPath
-
getPythonInterpreter
public static org.python.util.PythonInterpreter getPythonInterpreter() -
loadJython
- Throws:
Exception
-
listKnownScriptEngines
public void listKnownScriptEngines() -
inlineJython
protected static Object inlineJython(String className, Class mustImplement, String jythonCode) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
getJythonAcceptArgs
-
loadExternal
public static Object loadExternal(String tagName, String[] armNames, Element config) throws Exception loads the class named in the element "classname" in config with config as a costructor argument. If the loaded class doesnt implement mustImplement, a configuration exception is thrown- Throws:
Exception
-
loadUnit
public static edu.iris.Fissures.model.UnitImpl loadUnit(Element config) throws ConfigurationException - Throws:
ConfigurationException
-
loadTime
- Throws:
ConfigurationException
-
loadTime
public static MicroSecondDateSupplier loadTime(Element el, boolean endOfDay) throws ConfigurationException - Throws:
ConfigurationException
-
nowSupplier
-
createCalendar
public static Calendar createCalendar(int year, int month, int day, int hour, int minute, int second, boolean ceiling) Creates a calendar in the given year. Year must be specified, but all other fields can be -1 if unknown. If -1, they're either the greatest of least value of the calendar's current state depending on the value of ceiling. -
fillInField
-
getEarlierSupplier
public static MicroSecondDateSupplier getEarlierSupplier(edu.iris.Fissures.model.TimeInterval duration) -
getLaterSupplier
public static MicroSecondDateSupplier getLaterSupplier(edu.iris.Fissures.model.TimeInterval duration) -
loadTimeInterval
public static edu.iris.Fissures.model.TimeInterval loadTimeInterval(Element config) throws ConfigurationException - Throws:
ConfigurationException
-
loadQuantity
public static edu.iris.Fissures.model.QuantityImpl loadQuantity(Element config) throws ConfigurationException - Throws:
ConfigurationException
-
loadInt
-
loadFloat
-
loadText
-
copyFile
- Throws:
FileNotFoundException
-
copyStream
-
loadUnitRange
public static edu.iris.Fissures.model.UnitRangeImpl loadUnitRange(Element config) throws ConfigurationException - Throws:
ConfigurationException
-
loadTimeRange
public static MicroSecondTimeRangeSupplier loadTimeRange(Element config) throws ConfigurationException - Throws:
ConfigurationException
-
loadDimensions
- Throws:
Exception
-
nodeValueOfXPath
public static String nodeValueOfXPath(Element el, String xpath) throws DOMException, TransformerException - Throws:
DOMException
TransformerException
-
loadBoxArea
public static edu.iris.Fissures.model.BoxAreaImpl loadBoxArea(Element config) throws ConfigurationException - Throws:
ConfigurationException
-
getElement
returns the first element with the given name, null if none exists. -
getAllElements
returns all the element with the given name -
getFirstEmbeddedElement
-
getText
returns the first text child within the node. -
getNestedText
returns the nested text in the tag * -
getRelativePath
-
getAbsolutePath
- Throws:
IOException
-
loadProperties
-
intArrayFromList
-
getSimpleName
-