|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openptk.structure.Structure
public abstract class Structure
The abstract base class for a Structure. Provides core method implementations.
Field Summary |
---|
Constructor Summary | |
---|---|
Structure(java.lang.String name)
Create a new Structure using the provided name. |
|
Structure(java.lang.String name,
boolean value)
Create a new Structure using the provided name and value. |
|
Structure(java.lang.String name,
java.lang.Boolean value)
Create a new Structure using the provided name and value. |
|
Structure(java.lang.String name,
java.lang.Boolean[] values)
Create a new Structure using the provided name and array of values. |
|
Structure(java.lang.String name,
int value)
Create a new Structure using the provided name and value. |
|
Structure(java.lang.String name,
java.lang.Integer value)
Create a new Structure using the provided name and value. |
|
Structure(java.lang.String name,
java.lang.Integer[] values)
Create a new Structure using the provided name and array of values. |
|
Structure(java.lang.String name,
java.util.List<java.lang.String> values)
Create a new Structure using the provided name and List of values. |
|
Structure(java.lang.String name,
long value)
Create a new Structure using the provided name and value. |
|
Structure(java.lang.String name,
java.lang.Long value)
Create a new Structure using the provided name and value. |
|
Structure(java.lang.String name,
java.lang.Long[] values)
Create a new Structure using the provided name and array of values. |
|
Structure(java.lang.String name,
java.lang.Object value)
Create a new Structure using the provided name and value. |
|
Structure(java.lang.String name,
java.lang.Object[] values)
Create a new Structure using the provided name and array of values. |
|
Structure(java.lang.String name,
java.lang.String value)
Create a new Structure using the provided name and value. |
|
Structure(java.lang.String name,
java.lang.String[] values)
Create a new Structure using the provided name and Array of values. |
|
Structure(java.lang.String name,
StructureIF struct)
Create a new Structure using the provide name and child Structure. |
Method Summary | |
---|---|
void |
addChild(StructureIF child)
Adds the provided Structure as a Child. |
void |
addValue(boolean value)
Add boolean to the Structure value. |
void |
addValue(java.lang.Boolean value)
Add Boolean to the Structure value. |
void |
addValue(int value)
Add integer to the Structure value. |
void |
addValue(java.lang.Integer value)
Add Integer to the Structure value. |
void |
addValue(long value)
Add long to the Structure value. |
void |
addValue(java.lang.Long value)
Add Long to the Structure value. |
void |
addValue(java.lang.Object value)
Add Object to the Structure value. |
void |
addValue(java.lang.String value)
Add String to the Structure value. |
StructureIF |
getChild(java.lang.String name)
Returns the specified Child Structure. |
java.util.List<StructureIF> |
getChildren()
Returns all Child Structures as a List. |
java.util.List<StructureIF> |
getChildren(java.lang.String name)
Returns a List (of Children) that match the provided name. |
StructureIF[] |
getChildrenAsArray()
Returns all Child Structures as an Array. |
StructureIF[] |
getChildrenAsArray(java.lang.String name)
Returns an Structure array (of Children) that match the provided name. |
java.lang.String[] |
getChildrenIds()
Returns a String Array containing the Childrens id (name). |
java.lang.String |
getName()
Get the Structure name. |
StructureIF |
getParent()
Returns the Structure Parent (if it is a Child). |
State |
getState()
Get the Structure's State. |
java.lang.Object |
getValue()
Returns the value (if single valued) or the first value (is multi valued) If there is no value, null will be returned. |
java.lang.String |
getValueAsString()
Returns a String representation of the (first) value. |
java.util.List<java.lang.Object> |
getValues()
Returns the List of values (Object). |
java.lang.Object[] |
getValuesAsArray()
Returns an Array of values (Object). |
java.lang.String |
getValuesAsString()
Returns a String representation of all (List) the values. |
StructureType |
getValueType()
Returns the Structure Type. |
boolean |
hasChild(java.lang.String name)
Returns TRUE if a Child exists with the specified name. |
boolean |
hasChildren()
Returns TRUE if the Structure contains one or more Children. |
boolean |
isMultiValued()
Returns TRUE if the Structure contains more than 1 (one) value. |
void |
setChild(int index,
StructureIF child)
Sets / Replaces a specific Child with the provided Structure. |
void |
setName(java.lang.String name)
Set the Structure's name. |
void |
setParent(StructureIF struct)
Set the Structure's parent. |
void |
setState(State state)
Set the Structure State. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Structure(java.lang.String name)
name
- Name of the Structurepublic Structure(java.lang.String name, boolean value)
name
- Name of the Structurevalue
- booleanpublic Structure(java.lang.String name, java.lang.Boolean value)
name
- Name of the Structurevalue
- Booleanpublic Structure(java.lang.String name, java.lang.Boolean[] values)
name
- Name of the Structurevalues
- Array of Boolean valuespublic Structure(java.lang.String name, int value)
name
- Name of the Structurevalue
- Structure integer valuepublic Structure(java.lang.String name, java.lang.Integer value)
name
- Name of the Structurevalue
- Structure Integer valuepublic Structure(java.lang.String name, java.lang.Integer[] values)
name
- Name of the Structurevalues
- Array of Integerspublic Structure(java.lang.String name, java.util.List<java.lang.String> values)
name
- Name of the Structurevalues
- List of valuespublic Structure(java.lang.String name, long value)
name
- Name of the Structurevalue
- Structure long valuepublic Structure(java.lang.String name, java.lang.Long value)
name
- Name of the Structurevalue
- Structure Long valuepublic Structure(java.lang.String name, java.lang.Long[] values)
name
- Name of the Structurevalues
- Array of Longspublic Structure(java.lang.String name, java.lang.Object value)
name
- Name of the Structurevalue
- Objectpublic Structure(java.lang.String name, java.lang.Object[] values)
name
- Name of the Structurevalues
- Array of Object valuespublic Structure(java.lang.String name, java.lang.String value)
name
- Name of the Structurevalue
- Structure valuepublic Structure(java.lang.String name, java.lang.String[] values)
name
- Name of the Structurevalues
- Array of valuespublic Structure(java.lang.String name, StructureIF struct)
name
- Name of the Structurestruct
- The child StructureMethod Detail |
---|
public final void addChild(StructureIF child) throws StructureException
addChild
in interface StructureIF
child
- Child Structure
StructureException
public final void addValue(boolean value) throws StructureException
addValue
in interface StructureIF
value
- boolean to add
StructureException
public final void addValue(java.lang.Boolean value) throws StructureException
addValue
in interface StructureIF
value
- Boolean to add
StructureException
public final void addValue(int value) throws StructureException
addValue
in interface StructureIF
value
- integer to add
StructureException
public final void addValue(java.lang.Integer value) throws StructureException
addValue
in interface StructureIF
value
- Integer to add
StructureException
public final void addValue(long value) throws StructureException
addValue
in interface StructureIF
value
- long to add
StructureException
public final void addValue(java.lang.Long value) throws StructureException
addValue
in interface StructureIF
value
- Long to add
StructureException
public final void addValue(java.lang.Object value) throws StructureException
addValue
in interface StructureIF
value
- Object to add
StructureException
public final void addValue(java.lang.String value) throws StructureException
addValue
in interface StructureIF
value
- String to add
StructureException
public final StructureIF getChild(java.lang.String name)
getChild
in interface StructureIF
name
- Child Structure name
public final java.util.List<StructureIF> getChildren()
getChildren
in interface StructureIF
public final java.util.List<StructureIF> getChildren(java.lang.String name)
getChildren
in interface StructureIF
name
- The child name
public final StructureIF[] getChildrenAsArray()
getChildrenAsArray
in interface StructureIF
public final StructureIF[] getChildrenAsArray(java.lang.String name)
getChildrenAsArray
in interface StructureIF
name
- The child name
public final java.lang.String[] getChildrenIds()
getChildrenIds
in interface StructureIF
public final java.lang.String getName()
getName
in interface StructureIF
public final StructureIF getParent()
getParent
in interface StructureIF
public final State getState()
getState
in interface StructureIF
public final java.lang.Object getValue()
getValue
in interface StructureIF
public final java.lang.String getValueAsString()
getValueAsString
in interface StructureIF
public final java.util.List<java.lang.Object> getValues()
getValues
in interface StructureIF
public final java.lang.Object[] getValuesAsArray()
getValuesAsArray
in interface StructureIF
public final java.lang.String getValuesAsString()
getValuesAsString
in interface StructureIF
public final StructureType getValueType()
getValueType
in interface StructureIF
public final boolean hasChild(java.lang.String name)
hasChild
in interface StructureIF
name
- Child Structure name
public final boolean hasChildren()
hasChildren
in interface StructureIF
public final boolean isMultiValued()
isMultiValued
in interface StructureIF
public final void setChild(int index, StructureIF child) throws StructureException
setChild
in interface StructureIF
index
- child offsetchild
- Child Structure
StructureException
public final void setName(java.lang.String name)
setName
in interface StructureIF
name
- Structure's namepublic final void setParent(StructureIF struct)
Note: In most situation this method should not be used / needed. The Child/Parent relationship is maintained by the addChild() and setChild() methods.
setParent
in interface StructureIF
struct
- Parent Structurepublic final void setState(State state)
setState
in interface StructureIF
state
- A valid Statepublic final java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |