public class STMLArray extends STMLElement implements HasUnits, HasArraySize, HasDataType, HasDictRef, HasDelimiter
| Modifier and Type | Field and Description |
|---|---|
static String |
TAG |
attributeFactoryATTRIBUTES, AUTOGENERATED_DONOTEDIT_S, BANNER_S, CATALOG_XML, CML_SIUNITS, CML_UNITS, ELEMENTS, FPX_REAL, JAVA_ARRAY, JAVA_BOOL, JAVA_BOOLEAN, JAVA_DOUB, JAVA_DOUBLE, JAVA_INT, JAVA_INTEGER, JAVA_STRING, PATTERN_ANYURI, PATTERN_QNAME, SVG_NS, SVG_NS_BASE, SVG_XPATH, TYPES, U_ANGSTROM, U_CELSIUS, U_DEGREE, U_KCAL, WARNING_S, X_OR, XHTML_NS, XLINK_NS, XLINK_PREFIX, XML_SUFF, XMLNS, XPATH_XSD, XSD_ANNOTATION, XSD_ANYURI, XSD_ATTRIBUTE, XSD_ATTRIBUTE_GROUP, XSD_BOOLEAN, XSD_COMPLEX_TYPE, XSD_DATE, XSD_DOCUMENTATION, XSD_DOUBLE, XSD_ELEMENT, XSD_ENUMERATION, XSD_EXTENSION, XSD_FLOAT, XSD_INTEGER, XSD_LENGTH, XSD_LIST, XSD_MAXEXCLUSIVE, XSD_MAXINCLUSIVE, XSD_MINEXCLUSIVE, XSD_MININCLUSIVE, XSD_NONNEGATIVEINTEGER, XSD_NS, XSD_PATTERN, XSD_POSITIVE_NUMBER, XSD_POSITIVEINTEGER, XSD_PREFIX, XSD_QNAME, XSD_RESTRICTION, XSD_SIMPLE_CONTENT, XSD_SIMPLE_TYPE, XSD_STRING, XSD_SUFF, XSD_UNION, XSD_XMLNSC_AMP, C_APOS, C_ATSIGN, C_BACKSLASH, C_BACKSPACE, C_CARET, C_COLON, C_COMMA, C_DEL, C_DOLLAR, C_EQUALS, C_FORMFEED, C_HASH, C_LANGLE, C_LBRAK, C_LCURLY, C_LSQUARE, C_MINUS, C_NBSP, C_NEWLINE, C_NL, C_PERCENT, C_PERIOD, C_PIPE, C_PLUS, C_POUND, C_QUERY, C_QUOT, C_RANGLE, C_RBRAK, C_RCURLY, C_RETURN, C_RSQUARE, C_SEMICOLON, C_SHRIEK, C_SLASH, C_SPACE, C_STAR, C_TAB, C_TILDE, C_UNDER, EPS, F_S, NONWHITEPUNC, NONWHITEPUNC0, NONWHITEPUNC0REGEX, ONE_THIRD, PUNC, S_AMP, S_APOS, S_ATSIGN, S_BACKSLASH, S_CARET, S_COLON, S_COMMA, S_DOLLAR, S_EMPTY, S_EQUALS, S_FORMFEED, S_HASH, S_LANGLE, S_LBRAK, S_LCURLY, S_LSQUARE, S_MINUS, S_NEWLINE, S_NL, S_PERCENT, S_PERIOD, S_PIPE, S_PLUS, S_POUND, S_QUERY, S_QUOT, S_RANGLE, S_RBRAK, S_RCURLY, S_RETURN, S_RSQUARE, S_SEMICOLON, S_SHRIEK, S_SLASH, S_SPACE, S_STAR, S_TAB, S_TILDE, S_UNDER, S_WHITEREGEX, TWO_THIRDS, U_S, WHITESPACE| Constructor and Description |
|---|
STMLArray()
constructor.
|
STMLArray(boolean[] array)
formed from components.
|
STMLArray(org.joda.time.DateTime[] array)
formed from components.
|
STMLArray(double[] array)
formed from components.
|
STMLArray(double[] array,
String delimiter)
formed from components.
|
STMLArray(int[] array)
formed from components.
|
STMLArray(int[] array,
String delimiter)
formed from components.
|
STMLArray(RealArray array)
formed from components.
|
STMLArray(STMLArray old)
constructor.
|
STMLArray(String dataType)
creates array of given dataType
|
STMLArray(String[] array)
formed from components.
|
STMLArray(String[] array,
String delimiter)
formed from components.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(boolean b)
add a double.
|
void |
append(org.joda.time.DateTime d)
add an integer.
|
void |
append(double d)
add a double.
|
void |
append(HasDictRef hasDictRef) |
void |
append(int i)
add an integer.
|
void |
append(STMLArray array) |
void |
append(STMLScalar scalar) |
void |
append(String s)
add a string.
|
void |
checkNumericConformability(STMLArray array)
can two arrays be used for arithmetic.
|
nu.xom.Element |
copy()
copy node .
|
static void |
copyAttributesFromTo(nu.xom.Element from,
nu.xom.Element to) |
static STMLArray |
createArray(List<STMLScalar> scalarList) |
static STMLArray |
createArrayWithAttributes(HasDataType hasDataType) |
STMLArray |
createEmptyArray(STMLScalar scalar)
creates array of type comptatible with scalar can be used to add
subsequently scalar contents to array does NOT add scalar contents
typical use:
|
STMLArray |
createSubArray(int start,
int end)
creates a new array formed from a subset of the current array
|
void |
ensureDelimiterAttribute(DelimiterAttribute.Action action) |
static List<STMLArray> |
extractArrays(List<nu.xom.Element> elements)
makes a list of STMLArrays
|
int |
getArraySize()
get size of array.
|
boolean[] |
getBooleans()
get doubles.
|
String |
getDataType()
get dataType.
|
STMLAttribute |
getDataTypeAttribute()
The data type of the object.
|
org.joda.time.DateTime[] |
getDates()
get dates
|
String |
getDelimiter()
reset null to whitespace, etc.
|
String |
getDictRef()
null
|
STMLAttribute |
getDictRefAttribute()
null
|
double[] |
getDoubles()
get doubles.
|
STMLScalar |
getElementAt(int i) |
int[] |
getInts()
get ints.
|
double[] |
getNumbersAsDoubles()
convenience method returns a list of doubles for either xsd:integer or xsd:double
|
Object |
getPrimitiveArray()
returns array of primitive types based on dataType.
|
int |
getSize()
gets size of array.
|
String[] |
getStrings()
get strings.
|
List<String> |
getStringValues()
returns the String value of the array.
|
String |
getUnits()
null
|
String |
getXMLContent()
gets value of element;
|
STMLArray |
plus(STMLArray array)
add an array to this..
|
void |
removeWhitespaceDelimiterAttribute()
removes attributes of the form delimiter="" or delimiter=" "
|
static void |
removeWhitespaceDelimiterAttribute(HasDelimiter hasDelimiter) |
void |
setArray(boolean[] array)
sets components.
|
void |
setArray(org.joda.time.DateTime[] array)
sets components.
|
void |
setArray(double[] array)
sets components.
|
void |
setArray(int[] array)
sets components.
|
void |
setArray(String[] array)
sets components.
|
void |
setDataType(String dType)
set dataType.
|
void |
setDelimiter(String value)
set delimiter.
|
void |
setDictRef(String dictRef)
null
|
void |
setSize(int s)
Deprecated.
not user-accesible - throws STMLRuntime sets delimiter. Cannot
reset after array is populated if delimiter is whitespace,
removes the attribute
|
void |
setUnits(String prefix,
String id,
String namespaceURI)
sets units attribute.
|
void |
setXMLContent(String content)
sets value of element;
|
STMLArray |
subtract(STMLArray array)
subtract an array from this..
|
addRemove, addSTMLXAttribute, appendChild, copyAttributesFrom, copyChildrenFrom, copyChildrenFromTo, createSubclassedChildren, debug, debug, debug, debug, deleteAttribute, detach, getConstantToSI, getConstantToSIAttribute, getConvention, getConventionAttribute, getDelimiterAttribute, getId, getIdAttribute, getNamespaceURIForPrefix, getSizeAttribute, getSTMLAttributeValue, getSTMLXAttribute, getStringContent, getTool, getUnitsAttribute, insertChild, makeSTMLXAttribute, readAndCreateSTML, readAndCreateSTML, readAndCreateSTML, removeAttribute, replaceChild, serialize, setLocalName, setSize, setSTMLXAttribute, setStringContent, setTool, unknownAttributeName, writeHTMLaddAttribute, addNamespaceDeclaration, appendChild, getAttribute, getAttribute, getAttribute, getAttributeCount, getAttributeValue, getAttributeValue, getBaseURI, getChildElements, getChildElements, getChildElements, getFirstChildElement, getFirstChildElement, getLocalName, getNamespaceDeclarationCount, getNamespacePrefix, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getQualifiedName, getValue, insertChild, removeAttribute, removeChildren, removeNamespaceDeclaration, setBaseURI, setNamespacePrefix, setNamespaceURI, shallowCopy, toString, toXMLgetChild, getChildCount, indexOf, removeChild, removeChildclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDelimiterAttributepublic static final String TAG
public STMLArray()
public STMLArray(STMLArray old)
old - public STMLArray(String[] array) throws RuntimeException
array - RuntimeException - strings must not contain whitespacepublic STMLArray(String[] array, String delimiter) throws RuntimeException
array - delimiter - RuntimeException - strings must not contain delimiterpublic STMLArray(RealArray array)
array - public STMLArray(double[] array)
array - public STMLArray(boolean[] array)
array - public STMLArray(double[] array,
String delimiter)
throws RuntimeException
array - delimiter - RuntimeException - strings must not contain delimiterpublic STMLArray(org.joda.time.DateTime[] array)
array - public STMLArray(int[] array)
array - public STMLArray(int[] array,
String delimiter)
array - delimiter - public STMLArray(String dataType)
dataType - public nu.xom.Element copy()
copy in class STMLElementpublic static STMLArray createArray(List<STMLScalar> scalarList)
public static STMLArray createArrayWithAttributes(HasDataType hasDataType)
public STMLArray createEmptyArray(STMLScalar scalar)
List<STMLScalar> scalars; STMLArray array =
STMLArray.createEmptyArray(scalars.get(0)); for (STMLScalar scalar :
scalars) { array.append(scalar); }
scalar - public STMLArray createSubArray(int start, int end) throws IllegalArgumentException
start - inclusive startend - inclusive endIllegalArgumentException - if indices are out of boundspublic int getArraySize()
getArraySize in interface HasArraySizepublic Object getPrimitiveArray()
public String[] getStrings()
public boolean[] getBooleans()
throws RuntimeException
RuntimeExceptionpublic double[] getDoubles()
throws RuntimeException
getDoubles in interface HasArraySizeRuntimeExceptionpublic double[] getNumbersAsDoubles()
public org.joda.time.DateTime[] getDates()
throws RuntimeException
RuntimeExceptionpublic int[] getInts()
throws RuntimeException
getInts in interface HasArraySizeRuntimeExceptionpublic STMLScalar getElementAt(int i)
public static void copyAttributesFromTo(nu.xom.Element from,
nu.xom.Element to)
public List<String> getStringValues()
getStringValues in interface HasArraySizepublic void setArray(String[] array) throws RuntimeException
array - RuntimeExceptionpublic void setArray(org.joda.time.DateTime[] array)
array - public void setArray(boolean[] array)
array - public void setArray(double[] array)
array - public void setArray(int[] array)
array - public int getSize()
getSize in class STMLElementpublic String getDelimiter()
getDelimiter in interface HasDelimitergetDelimiter in class STMLElementpublic void setDelimiter(String value)
setDelimiter in interface HasDelimitersetDelimiter in class STMLElementvalue - public String getDataType()
getDataType in interface HasDataTypegetDataType in class STMLElementpublic void setDataType(String dType)
setDataType in interface HasDataTypesetDataType in class STMLElementdType - (default XSD_STRING)RuntimeException - attempt to reset datatypepublic void setSize(int s)
setSize in class STMLElements - the sizeRuntimeException - attempt to reset datatypepublic void checkNumericConformability(STMLArray array)
array - the array to test; can have different ownerpublic STMLArray subtract(STMLArray array)
array - the array to subtract; can have different ownerpublic STMLArray plus(STMLArray array)
array - the array to add; can have different ownerpublic void append(String s) throws RuntimeException
s - String to addRuntimeException - dataType not XSD_STRINGpublic void append(boolean b)
throws RuntimeException
b - RuntimeException - dataType not XSD_DOUBLEpublic void append(double d)
throws RuntimeException
d - double to addRuntimeException - dataType not XSD_DOUBLEpublic void append(int i)
throws RuntimeException
i - integer to addRuntimeException - dataType not XSD_INTEGERpublic void append(STMLArray array)
public void append(STMLScalar scalar)
public void append(HasDictRef hasDictRef)
public void setUnits(String prefix, String id, String namespaceURI)
public void append(org.joda.time.DateTime d)
throws RuntimeException
d - date to addRuntimeExceptionpublic void removeWhitespaceDelimiterAttribute()
removeWhitespaceDelimiterAttribute in interface HasDelimiterpublic static void removeWhitespaceDelimiterAttribute(HasDelimiter hasDelimiter)
public static List<STMLArray> extractArrays(List<nu.xom.Element> elements)
elements - List<STMLArray>public STMLAttribute getDictRefAttribute()
STMLElementgetDictRefAttribute in interface HasDictRefgetDictRefAttribute in class STMLElementpublic String getDictRef()
STMLElementgetDictRef in interface HasDictRefgetDictRef in class STMLElementpublic void setDictRef(String dictRef)
STMLElementsetDictRef in interface HasDictRefsetDictRef in class STMLElementdictRef - title valuepublic String getXMLContent()
HasDataTypegetXMLContent in interface HasDataTypegetXMLContent in class STMLElementpublic void setXMLContent(String content)
HasDataTypesetXMLContent in interface HasDataTypesetXMLContent in class STMLElementcontent - title valuepublic String getUnits()
STMLElementgetUnits in interface HasUnitsgetUnits in class STMLElementpublic void ensureDelimiterAttribute(DelimiterAttribute.Action action)
public STMLAttribute getDataTypeAttribute()
getDataTypeAttribute in class STMLElementCopyright © 1994–2024 Peter Murray-Rust. All rights reserved.