public final class PsXmlLoader
extends java.lang.Object
Constructor and Description |
---|
PsXmlLoader() |
Modifier and Type | Method and Description |
---|---|
static PsXmlNode |
addColor(PsXmlNode parentNode,
java.lang.String colorLabel,
java.awt.Color color)
Create a new node containing the given argument color.
|
static PsXmlNode |
addColor(PsXmlNode parentNode,
java.lang.String typeLabel,
java.lang.String colorLabel,
java.awt.Color color)
Create a new node with a child node containing the given argument color.
|
static PsXmlNode |
addMatrix(PsXmlNode parentNode,
java.lang.String type,
PdMatrix matrix)
Write matrix whose element type is passed as argument.
|
static PsXmlNode |
addVector(PsXmlNode parentNode,
java.lang.String type,
PdVector vector,
boolean bAttr)
Create a new node with the content of the given argument vector.
|
static PsXmlNode |
addVector(PsXmlNode parentNode,
java.lang.String type,
PiVector vector,
boolean bAttr)
Create a new node with the content of the given argument vector.
|
static void |
addVectorList(PsXmlNode parentNode,
java.lang.String type,
java.awt.Color[] vector,
int length) |
static void |
addVectorList(PsXmlNode parentNode,
java.lang.String type,
PdVector[][] vector,
int length) |
static void |
addVectorList(PsXmlNode parentNode,
java.lang.String type,
PdVector[] vector,
int length) |
static void |
addVectorList(PsXmlNode parentNode,
java.lang.String type,
PdVector vector,
int length) |
static void |
addVectorList(PsXmlNode parentNode,
java.lang.String type,
PiVector[] vector,
int length) |
static java.awt.Color |
parseColorContent(PsXmlNode p)
Parse a PsXmlNode whose content consists of rgb color components.
|
static java.awt.Color[] |
parseColorList(PsXmlNode parentNode,
java.lang.String type)
Parse an array of PsXmlNodes of same element type, where each element
has data consisting of a blank separated list of integers.
|
static java.awt.Color |
parseColorRGB(PsXmlNode parentNode,
java.lang.String type)
Parse a PsXmlNode whose child has a set of rgb color components.
|
static PdVector[] |
parseDoubleList(PsXmlNode parentNode,
java.lang.String type,
java.lang.String[] attr)
Parse an array of PsXmlNodes of same element type, where each element
has data consisting of a blank separated list of doubles.
|
static PiVector[] |
parseIntegerList(PsXmlNode parentNode,
java.lang.String type,
java.lang.String[] attr)
Parse an array of PsXmlNodes of same element type, where each element
has data consisting of a blank separated list of integers.
|
static PdMatrix |
parsePdMatrix(PsXmlNode parentNode,
java.lang.String type)
Parse a double matrix from a blank separated string of doubles.
|
static PdVector |
parsePdVector(PsXmlNode p,
java.lang.String[] attr)
Parse element content consisting of blank separated list of doubles.
|
static PdVector |
parsePdVector(PsXmlNode parentNode,
java.lang.String type,
java.lang.String[] attr)
Parse a PsXmlNode whose child has a set of double values.
|
static PdVector |
parsePdVector(java.lang.String string)
Parse a double vector from a blank separated string of doubles.
|
static PiVector |
parsePiVector(PsXmlNode p,
java.lang.String[] attr)
Parse element content consisting of a blank separated list of integers.
|
static PiVector |
parsePiVector(PsXmlNode parentNode,
java.lang.String type,
java.lang.String[] attr)
Parse a PsXmlNode whose child has a set of integer values.
|
static PiVector |
parsePiVector(java.lang.String string)
Parse an integer vector from a blank separated string of integers.
|
static void |
parseVectorAttr(P_Vector vec,
PsXmlNode p,
java.lang.String[] attr)
Parse vector attributes of PdVector and PiVector.
|
static PsXmlSrc |
read(java.io.BufferedReader in)
Read XML file and fill a new PsXmlSrc class.
|
static PsXmlSrc |
read(java.lang.String fileName)
Read XML file and fill a new PsXmlSrc class.
|
public static PsXmlSrc read(java.lang.String fileName)
fileName
- File or URL to read data from.public static PsXmlSrc read(java.io.BufferedReader in)
in
- BufferedReader to read textual data from.public static PdVector[] parseDoubleList(PsXmlNode parentNode, java.lang.String type, java.lang.String[] attr)
parentNode
- parent node containing a set of PdVector nodes as childrentype
- type of elements in arrayattr
- array of attributes the vector might have, may be null.public static PdVector parsePdVector(PsXmlNode parentNode, java.lang.String type, java.lang.String[] attr)
parentNode
- node whose child has a set of double values.public static PdVector parsePdVector(PsXmlNode p, java.lang.String[] attr)
p
- node whose content is a list of double values.attr
- array of attributes the vector might have, may be null.public static void parseVectorAttr(P_Vector vec, PsXmlNode p, java.lang.String[] attr)
vec
- vector whose attributes will be set.p
- node with attribute values.attr
- array of attribute keys the node might have, may be null.public static PdVector parsePdVector(java.lang.String string)
string
- string with double componentspublic static PdMatrix parsePdMatrix(PsXmlNode parentNode, java.lang.String type)
parentNode
- parent node containing a matrix.type
- type of the matrix element in parent node.null
if no doubles available.public static PiVector parsePiVector(java.lang.String string)
string
- string with integer componentspublic static PiVector[] parseIntegerList(PsXmlNode parentNode, java.lang.String type, java.lang.String[] attr)
parentNode
- parent node containing a set of PiVector nodes as childrentype
- type of elements in arrayattr
- array of attributes the vector might have, may be null.public static PiVector parsePiVector(PsXmlNode parentNode, java.lang.String type, java.lang.String[] attr)
parentNode
- node whose child has a set of integer values.public static PiVector parsePiVector(PsXmlNode p, java.lang.String[] attr)
p
- node whose content is a set of integer values.attr
- array of attributes the vector might have, may be null.public static java.awt.Color[] parseColorList(PsXmlNode parentNode, java.lang.String type)
parentNode
- parent node containing a set of color nodes as childrentype
- type of elements in arraypublic static java.awt.Color parseColorRGB(PsXmlNode parentNode, java.lang.String type)
parentNode
- node whose child has a set of rgb colors values.public static java.awt.Color parseColorContent(PsXmlNode p)
p
- node whose content is a set of rgb colors values.public static PsXmlNode addMatrix(PsXmlNode parentNode, java.lang.String type, PdMatrix matrix)
public static void addVectorList(PsXmlNode parentNode, java.lang.String type, PdVector vector, int length)
public static void addVectorList(PsXmlNode parentNode, java.lang.String type, PdVector[] vector, int length)
public static void addVectorList(PsXmlNode parentNode, java.lang.String type, PiVector[] vector, int length)
public static PsXmlNode addVector(PsXmlNode parentNode, java.lang.String type, PdVector vector, boolean bAttr)
public static PsXmlNode addVector(PsXmlNode parentNode, java.lang.String type, PiVector vector, boolean bAttr)
public static void addVectorList(PsXmlNode parentNode, java.lang.String type, PdVector[][] vector, int length)
public static void addVectorList(PsXmlNode parentNode, java.lang.String type, java.awt.Color[] vector, int length)
public static PsXmlNode addColor(PsXmlNode parentNode, java.lang.String typeLabel, java.lang.String colorLabel, java.awt.Color color)
parentNode
- existing parent nodetypeLabel
- element type of the nodecolorLabel
- element type of the child node containing the colorcolor
- color to be written to the child node.public static PsXmlNode addColor(PsXmlNode parentNode, java.lang.String colorLabel, java.awt.Color color)
parentNode
- existing parent nodecolorLabel
- element type of the new color nodecolor
- color to be written to the child node."