|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.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 object| Method Detail |
|---|
public final void addAttribute(AttributeIF attr)
addAttribute in interface ElementIFattr - an existing AttributeIFpublic final void addAttribute(java.lang.String name)
addAttribute in interface ElementIFname - of the Attribute
public final void addAttribute(java.lang.String name,
boolean value)
addAttribute in interface ElementIFname - of the Attributevalue - TRUE/FALSE
public final void addAttribute(java.lang.String name,
java.lang.Boolean value)
addAttribute in interface ElementIFname - of the Attributevalue - TRUE/FALSE
public final void addAttribute(java.lang.String name,
java.lang.Boolean[] value)
addAttribute in interface ElementIFname - of the Attributevalue - TRUE/FALSE
public final void addAttribute(java.lang.String name,
int value)
addAttribute in interface ElementIFname - of the Attributevalue - integer
public final void addAttribute(java.lang.String name,
java.lang.Integer value)
addAttribute in interface ElementIFname - of the Attributevalue - Integer
public final void addAttribute(java.lang.String name,
java.lang.Integer[] value)
addAttribute in interface ElementIFname - of the Attributevalue - Integer[]
public final void addAttribute(java.lang.String name,
long value)
addAttribute in interface ElementIFname - of the Attributevalue - Long
public final void addAttribute(java.lang.String name,
java.lang.Long value)
addAttribute in interface ElementIFname - of the Attributevalue - Long
public final void addAttribute(java.lang.String name,
java.lang.Long[] value)
addAttribute in interface ElementIFname - of the Attributevalue - Long[]
public final void addAttribute(java.lang.String name,
java.lang.Object value)
addAttribute in interface ElementIFname - of the Attributevalue - Object
public final void addAttribute(java.lang.String name,
java.lang.String value)
addAttribute in interface ElementIFname - of the Attributevalue - of the Attribute
public final void addAttribute(java.lang.String name,
java.lang.String[] values)
addAttribute in interface ElementIFname - of the Attributevalues - String[] with multiple valuespublic final void addAttributes(java.util.List<java.lang.String> names)
addAttributes in interface ElementIFnames - List of Attributes to addpublic ElementIF copy()
copy in interface ElementIFpublic final AttributeIF getAttribute(java.lang.String name)
getAttribute in interface ElementIFname - the Attributes name
public final java.lang.String[] getAttributeNames()
getAttributeNames in interface ElementIFpublic final java.util.Map<java.lang.String,AttributeIF> getAttributes()
getAttributes in interface ElementIFpublic final int getAttributesSize()
getAttributesSize in interface ElementIFpublic final java.lang.String getDescription()
getDescription in interface ElementIFpublic final java.lang.String getKey()
getKey in interface ElementIFpublic final java.util.Properties getProperties()
getProperties in interface ElementIFpublic final int getPropertiesSize()
getPropertiesSize in interface ElementIFpublic final java.lang.String getProperty(java.lang.String key)
getProperty in interface ElementIFkey - for the property
public final State getState()
getState in interface ElementIFpublic final java.lang.String getStateAsString()
getStateAsString in interface ElementIFpublic final java.lang.String getStatus()
getStatus in interface ElementIFpublic final java.lang.Object getUniqueId()
getUniqueId in interface ElementIFpublic final DataType getUniqueIdType()
getUniqueIdType in interface ElementIFpublic final boolean isError()
isError in interface ElementIFpublic final void removeAttribute(java.lang.String name)
removeAttribute in interface ElementIFname - the Attributes namepublic final void removeProperty(java.lang.String key)
removeProperty in interface ElementIFkey - name of the propertypublic final void setAttributes(java.util.Map<java.lang.String,AttributeIF> map)
setAttributes in interface ElementIFmap - Collection of new AttributeIF itemspublic final void setDescription(java.lang.String str)
setDescription in interface ElementIFstr - the description for the Elementpublic final void setError(boolean error)
setError in interface ElementIFerror - set the error flagpublic final void setKey(java.lang.String key)
setKey in interface ElementIFkey - the name of the attribute which defines the primary keypublic final void setProperties(java.util.Properties props)
setProperties in interface ElementIFprops - new properties object
public final void setProperty(java.lang.String key,
java.lang.String value)
setProperty in interface ElementIFkey - for the propertyvalue - for the propertypublic final void setState(State state)
setState in interface ElementIFstate - enumeration valuepublic final void setStatus(java.lang.String str)
setStatus in interface ElementIFstr - the Elements statuspublic final void setUniqueId(ElementIF elem)
setUniqueId in interface ElementIFpublic final void setUniqueId(java.lang.Integer value)
setUniqueId in interface ElementIFvalue - the Element's unique idpublic final void setUniqueId(java.lang.Long value)
setUniqueId in interface ElementIFvalue - the Element's unique idpublic final void setUniqueId(java.lang.String value)
setUniqueId in interface ElementIFvalue - 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 | |||||||