public class Utils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
HALFSECOND
_more_
|
static int |
JGREG
Returns the Julian day number that begins at noon of
this day, Positive year signifies A.D., negative year B.C.
|
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Appendable |
append(java.lang.Appendable sb,
java.lang.String s)
_more_
|
static double |
decodeLatLon(java.lang.String latlon)
This method is taken from Unidatas ucar.unidata.util.Misc method.
|
static java.util.Date |
extractDate(java.lang.String s)
_more_
|
static java.lang.String |
extractPatternNames(java.lang.String filePatternString,
java.util.List<java.lang.String> patternNames)
_more_
|
static java.lang.reflect.Constructor |
findConstructor(java.lang.Class c,
java.lang.Class[] paramTypes)
_more_
|
static java.util.Date |
findDate(java.lang.String source,
java.lang.String[] datePatterns,
java.lang.String[] dateFormats)
_more_
|
static java.lang.String[] |
findPatterns(java.lang.String s,
java.lang.String regexp)
_more_
|
static int[] |
fromJulian(double injulian)
Converts a Julian day to a calendar date
ref :
Numerical Recipes in C, 2nd ed., Cambridge University Press 1992
|
static int[] |
fromJulian(double injulian,
int[] src)
_more_
|
static java.lang.String |
getArticle(java.lang.String s)
_more_
|
static boolean |
getAttributeOrTag(org.w3c.dom.Element node,
java.lang.String attrOrTag,
boolean dflt)
_more_
|
static double |
getAttributeOrTag(org.w3c.dom.Element node,
java.lang.String attrOrTag,
double dflt)
_more_
|
static int |
getAttributeOrTag(org.w3c.dom.Element node,
java.lang.String attrOrTag,
int dflt)
_more_
|
static java.lang.String |
getAttributeOrTag(org.w3c.dom.Element node,
java.lang.String attrOrTag,
java.lang.String dflt)
_more_
|
static int |
getMonth(java.util.Date date)
_more_
|
static java.util.Hashtable |
getProperties(java.lang.String s)
_more_
|
static int |
getYear(java.util.Date date)
_more_
|
static java.lang.String |
hexEncode(java.lang.String s)
_more_
|
static boolean |
isImage(java.lang.String path)
_more_
|
static void |
main(java.lang.String[] args)
_more_
|
static java.text.SimpleDateFormat |
makeDateFormat(java.lang.String format)
_more_
|
static java.util.Hashtable<java.lang.String,java.lang.String> |
makeMap(java.lang.String... args)
_more_
|
static java.lang.String |
makeProperties(java.util.Hashtable properties)
_more_
|
static double |
modifiedJulianToJulian(double modifiedJulian)
_more_
|
static java.awt.Image |
readImage(java.lang.String file)
_more_
|
static java.lang.String |
removeNonAscii(java.lang.String s)
_more_
|
static java.lang.Object |
safeGet(java.util.List list,
int index)
_more_
|
static java.io.File[] |
sortFilesOnSize(java.io.File[] files,
boolean ascending)
_more_
|
static boolean |
stringDefined(java.lang.String s)
_more_
|
static void |
testJulian(java.lang.String[] args)
_more_
|
static double |
toJulian(int[] ymd)
_more_
|
static boolean |
typesMatch(java.lang.Class[] formals,
java.lang.Class[] actuals)
_more_
|
public static int JGREG
public static double HALFSECOND
public static java.lang.Appendable append(java.lang.Appendable sb, java.lang.String s)
sb
- _more_s
- _more_public static boolean stringDefined(java.lang.String s)
s
- _more_public static double modifiedJulianToJulian(double modifiedJulian)
modifiedJulian
- _more_public static double toJulian(int[] ymd)
ymd
- _more_public static int[] fromJulian(double injulian)
injulian
- _more_public static int[] fromJulian(double injulian, int[] src)
injulian
- _more_src
- _more_public static void testJulian(java.lang.String[] args)
args
- _more_public static java.lang.String getArticle(java.lang.String s)
s
- _more_public static java.util.Date extractDate(java.lang.String s)
s
- _more_public static java.lang.reflect.Constructor findConstructor(java.lang.Class c, java.lang.Class[] paramTypes)
c
- _more_paramTypes
- _more_public static boolean typesMatch(java.lang.Class[] formals, java.lang.Class[] actuals)
formals
- _more_actuals
- _more_public static void main(java.lang.String[] args)
args
- _more_public static java.lang.String[] findPatterns(java.lang.String s, java.lang.String regexp) throws java.lang.Exception
s
- _more_regexp
- _more_java.lang.Exception
- _more_public static java.util.Date findDate(java.lang.String source, java.lang.String[] datePatterns, java.lang.String[] dateFormats) throws java.lang.Exception
source
- _more_datePatterns
- _more_dateFormats
- _more_java.lang.Exception
- _more_public static java.text.SimpleDateFormat makeDateFormat(java.lang.String format)
format
- _more_public static int getYear(java.util.Date date)
date
- _more_public static int getMonth(java.util.Date date)
date
- _more_public static java.lang.String removeNonAscii(java.lang.String s)
s
- _more_public static java.lang.String getAttributeOrTag(org.w3c.dom.Element node, java.lang.String attrOrTag, java.lang.String dflt) throws java.lang.Exception
node
- _more_attrOrTag
- _more_dflt
- _more_java.lang.Exception
- _more_public static boolean getAttributeOrTag(org.w3c.dom.Element node, java.lang.String attrOrTag, boolean dflt) throws java.lang.Exception
node
- _more_attrOrTag
- _more_dflt
- _more_java.lang.Exception
- _more_public static int getAttributeOrTag(org.w3c.dom.Element node, java.lang.String attrOrTag, int dflt) throws java.lang.Exception
node
- _more_attrOrTag
- _more_dflt
- _more_java.lang.Exception
- _more_public static double getAttributeOrTag(org.w3c.dom.Element node, java.lang.String attrOrTag, double dflt) throws java.lang.Exception
node
- _more_attrOrTag
- _more_dflt
- _more_java.lang.Exception
- _more_public static java.lang.String makeProperties(java.util.Hashtable properties)
properties
- _more_public static java.util.Hashtable<java.lang.String,java.lang.String> makeMap(java.lang.String... args)
args
- _more_public static java.util.Hashtable getProperties(java.lang.String s)
s
- _more_public static java.lang.String hexEncode(java.lang.String s)
s
- _more_public static boolean isImage(java.lang.String path)
path
- _more_public static java.io.File[] sortFilesOnSize(java.io.File[] files, boolean ascending)
files
- _more_ascending
- _more_public static java.lang.String extractPatternNames(java.lang.String filePatternString, java.util.List<java.lang.String> patternNames)
filePatternString
- _more_patternNames
- _more_public static java.awt.Image readImage(java.lang.String file)
file
- _more_public static double decodeLatLon(java.lang.String latlon)
+/- ddd:mm, ddd:mm:, ddd:mm:ss, ddd::ss, ddd.fffff ===> [+/-] ddd.fffff +/- ddd, ddd:, ddd:: ===> [+/-] ddd +/- :mm, :mm:, :mm:ss, ::ss, .fffff ===> [+/-] .fffff +/- :, :: ===> 0.0 Any of the above with N,S,E,W appended
latlon
- string representation of lat or lonpublic static java.lang.Object safeGet(java.util.List list, int index)
list
- _more_index
- _more_