|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openptk.api.Element
public class Element
An Element is a foundation class that holds Properties and Attributes. It has a unique id, a Description, State and Status
Constructor Summary | |
---|---|
Element()
Creates an empty element, The state is set to NEW. |
|
Element(ElementIF elem)
Create an Element using the provided element. |
Method Summary | |
---|---|
void |
addAttribute(AttributeIF attr)
Add an Attribute, copying an existing Attribute. |
void |
addAttribute(java.lang.String name)
Add an Attribute, name only, with no value. |
void |
addAttribute(java.lang.String name,
boolean value)
Add an Attribute with the give name and boolean value. |
void |
addAttribute(java.lang.String name,
java.lang.Boolean value)
Add an Attribute with the give name and Boolean value. |
void |
addAttribute(java.lang.String name,
java.lang.Boolean[] value)
Add an Attribute with the give name and Boolean value. |
void |
addAttribute(java.lang.String name,
int value)
Add an Attribute with the give name and integer value. |
void |
addAttribute(java.lang.String name,
java.lang.Integer value)
Add an Attribute with the give name and Integer value. |
void |
addAttribute(java.lang.String name,
java.lang.Integer[] value)
Add an Attribute with the give name and Integer[] value. |
void |
addAttribute(java.lang.String name,
long value)
Add an Attribute with the give name and Long value. |
void |
addAttribute(java.lang.String name,
java.lang.Long value)
Add an Attribute with the give name and Long value. |
void |
addAttribute(java.lang.String name,
java.lang.Long[] value)
Add an Attribute with the give name and Long[] value. |
void |
addAttribute(java.lang.String name,
java.lang.Object value)
Add an Attribute with the give name and Object value. |
void |
addAttribute(java.lang.String name,
java.lang.String value)
Add an Attribute with the give name and a single String value. |
void |
addAttribute(java.lang.String name,
java.lang.String[] values)
Add an Attribute with the give name and multiple String values. |
void |
addAttributes(java.util.List<java.lang.String> names)
Add multiple Attributes, with no value, one for each String. |
ElementIF |
copy()
Creates a "deep" copy of the Element. |
AttributeIF |
getAttribute(java.lang.String name)
Get the named Attribute. |
java.lang.String[] |
getAttributeNames()
Gets all the Attribute names. |
java.util.Map<java.lang.String,AttributeIF> |
getAttributes()
Get all of the Attributes as a Properties object. |
int |
getAttributesSize()
Get the number of Attributes. |
java.lang.String |
getDescription()
Get the Description a generic value that can be defined by the application. |
java.lang.String |
getKey()
Gets the name of the attribute which is defined as the unique primary key. |
java.util.Properties |
getProperties()
Get all of the Properties. |
int |
getPropertiesSize()
Get the number Property key/value pairs. |
java.lang.String |
getProperty(java.lang.String key)
Get a property value. |
State |
getState()
Returns the Element's State. |
java.lang.String |
getStateAsString()
Get the String representation for the current state. |
java.lang.String |
getStatus()
Get the status a general purpose piece of information that can store arbitrary information, typically used to store application status information. |
java.lang.Object |
getUniqueId()
Get the Unique ID, a generic identifier. |
DataType |
getUniqueIdType()
Get the Unique ID data type |
boolean |
isError()
Flag to determine if there was an Error. |
void |
removeAttribute(java.lang.String name)
Remove the named Attribute. |
void |
removeProperty(java.lang.String key)
Remove the named Property |
void |
setAttributes(java.util.Map<java.lang.String,AttributeIF> map)
Set / Replace all Attributes with the new Collection. |
void |
setDescription(java.lang.String str)
Set the Description, a generic value that can be defined. |
void |
setError(boolean error)
Flag to set if there is an Error. |
void |
setKey(java.lang.String key)
Sets the name of the attribute which is defined as the unique primary key. |
void |
setProperties(java.util.Properties props)
Set/Replace the properties with the new Properties. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Set a property using the key and value. |
void |
setState(State state)
Set the State. |
void |
setStatus(java.lang.String str)
Set the status a general purpose piece of information that can be used to store arbitrary information, typically used to store application level status information. |
void |
setUniqueId(ElementIF elem)
|
void |
setUniqueId(java.lang.Integer value)
Set the Unique ID to the Integer |
void |
setUniqueId(java.lang.Long value)
Set the Unique ID to the Long |
void |
setUniqueId(java.lang.String value)
Set the Unique ID to the String |
java.lang.String |
toString()
Information about the Element, summarize data into a String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Element()
public Element(ElementIF elem)
elem
- an existing ElementIF objectMethod Detail |
---|
public final void addAttribute(AttributeIF attr)
addAttribute
in interface ElementIF
attr
- an existing AttributeIFpublic final void addAttribute(java.lang.String name)
addAttribute
in interface ElementIF
name
- of the Attributepublic final void addAttribute(java.lang.String name, boolean value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- TRUE/FALSEpublic final void addAttribute(java.lang.String name, java.lang.Boolean value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- TRUE/FALSEpublic final void addAttribute(java.lang.String name, java.lang.Boolean[] value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- TRUE/FALSEpublic final void addAttribute(java.lang.String name, int value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- integerpublic final void addAttribute(java.lang.String name, java.lang.Integer value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- Integerpublic final void addAttribute(java.lang.String name, java.lang.Integer[] value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- Integer[]public final void addAttribute(java.lang.String name, long value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- Longpublic final void addAttribute(java.lang.String name, java.lang.Long value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- Longpublic final void addAttribute(java.lang.String name, java.lang.Long[] value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- Long[]public final void addAttribute(java.lang.String name, java.lang.Object value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- Objectpublic final void addAttribute(java.lang.String name, java.lang.String value)
addAttribute
in interface ElementIF
name
- of the Attributevalue
- of the Attributepublic final void addAttribute(java.lang.String name, java.lang.String[] values)
addAttribute
in interface ElementIF
name
- of the Attributevalues
- String[] with multiple valuespublic final void addAttributes(java.util.List<java.lang.String> names)
addAttributes
in interface ElementIF
names
- List of Attributes to addpublic ElementIF copy()
copy
in interface ElementIF
public final AttributeIF getAttribute(java.lang.String name)
getAttribute
in interface ElementIF
name
- the Attributes name
public final java.lang.String[] getAttributeNames()
getAttributeNames
in interface ElementIF
public final java.util.Map<java.lang.String,AttributeIF> getAttributes()
getAttributes
in interface ElementIF
public final int getAttributesSize()
getAttributesSize
in interface ElementIF
public final java.lang.String getDescription()
getDescription
in interface ElementIF
public final java.lang.String getKey()
getKey
in interface ElementIF
public final java.util.Properties getProperties()
getProperties
in interface ElementIF
public final int getPropertiesSize()
getPropertiesSize
in interface ElementIF
public final java.lang.String getProperty(java.lang.String key)
getProperty
in interface ElementIF
key
- for the property
public final State getState()
getState
in interface ElementIF
public final java.lang.String getStateAsString()
getStateAsString
in interface ElementIF
public final java.lang.String getStatus()
getStatus
in interface ElementIF
public final java.lang.Object getUniqueId()
getUniqueId
in interface ElementIF
public final DataType getUniqueIdType()
getUniqueIdType
in interface ElementIF
public final boolean isError()
isError
in interface ElementIF
public final void removeAttribute(java.lang.String name)
removeAttribute
in interface ElementIF
name
- the Attributes namepublic final void removeProperty(java.lang.String key)
removeProperty
in interface ElementIF
key
- name of the propertypublic final void setAttributes(java.util.Map<java.lang.String,AttributeIF> map)
setAttributes
in interface ElementIF
map
- Collection of new AttributeIF itemspublic final void setDescription(java.lang.String str)
setDescription
in interface ElementIF
str
- the description for the Elementpublic final void setError(boolean error)
setError
in interface ElementIF
error
- set the error flagpublic final void setKey(java.lang.String key)
setKey
in interface ElementIF
key
- the name of the attribute which defines the primary keypublic final void setProperties(java.util.Properties props)
setProperties
in interface ElementIF
props
- new properties objectpublic final void setProperty(java.lang.String key, java.lang.String value)
setProperty
in interface ElementIF
key
- for the propertyvalue
- for the propertypublic final void setState(State state)
setState
in interface ElementIF
state
- enumeration valuepublic final void setStatus(java.lang.String str)
setStatus
in interface ElementIF
str
- the Elements statuspublic final void setUniqueId(ElementIF elem)
setUniqueId
in interface ElementIF
public final void setUniqueId(java.lang.Integer value)
setUniqueId
in interface ElementIF
value
- the Element's unique idpublic final void setUniqueId(java.lang.Long value)
setUniqueId
in interface ElementIF
value
- the Element's unique idpublic final void setUniqueId(java.lang.String value)
setUniqueId
in interface ElementIF
value
- the Element's unique idpublic 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 |