org.deckfour.xes.model.impl
Class XAttributeImpl

java.lang.Object
  extended by org.deckfour.xes.model.impl.XAttributeImpl
All Implemented Interfaces:
Cloneable, Comparable<XAttribute>, XAttributable, XAttribute
Direct Known Subclasses:
XAttributeBooleanImpl, XAttributeContinuousImpl, XAttributeDiscreteImpl, XAttributeLiteralImpl, XAttributeTimestampImpl

public abstract class XAttributeImpl
extends Object
implements XAttribute

This class implements the abstract base class for strongly-typed attributes.

Author:
Christian W. Guenther (christian@deckfour.org)

Constructor Summary
protected XAttributeImpl(String key)
          Creates a new, empty attribute.
protected XAttributeImpl(String key, XExtension extension)
          Creates a new attribute.
 
Method Summary
 Object clone()
          Attributes must be cloneable.
 int compareTo(XAttribute o)
           
 boolean equals(Object obj)
           
 XAttributeMap getAttributes()
          Retrieves the attributes set for this element.
 XExtension getExtension()
          Retrieves the extension defining this attribute.
 Set<XExtension> getExtensions()
          Retrieves the extensions used by this element, i.e.
 String getKey()
          Retrieves the key, i.e.
 int hashCode()
           
 void setAttributes(XAttributeMap attributes)
          Sets the map of attributes for this element.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XAttributeImpl

protected XAttributeImpl(String key)
Creates a new, empty attribute.

Parameters:
key - The key, i.e. unique name identifier, of this attribute.

XAttributeImpl

protected XAttributeImpl(String key,
                         XExtension extension)
Creates a new attribute.

Parameters:
key - The key, i.e. unique name identifier, of this attribute.
extension - The extension used for defining this attribute.
Method Detail

getKey

public String getKey()
Description copied from interface: XAttribute
Retrieves the key, i.e. unique identifier, of this attribute.

Specified by:
getKey in interface XAttribute
Returns:
The key of this attribute, as a string.

getExtension

public XExtension getExtension()
Description copied from interface: XAttribute
Retrieves the extension defining this attribute.

Specified by:
getExtension in interface XAttribute
Returns:
The extension of this attribute. May return null, if there is no extension defining this attribute.

getAttributes

public XAttributeMap getAttributes()
Description copied from interface: XAttributable
Retrieves the attributes set for this element.

Specified by:
getAttributes in interface XAttributable
Returns:
A map of attributes.

setAttributes

public void setAttributes(XAttributeMap attributes)
Description copied from interface: XAttributable
Sets the map of attributes for this element.

Specified by:
setAttributes in interface XAttributable
Parameters:
attributes - A map of attributes.

getExtensions

public Set<XExtension> getExtensions()
Description copied from interface: XAttributable
Retrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself.

Specified by:
getExtensions in interface XAttributable
Returns:
A set of extensions.

clone

public Object clone()
Description copied from interface: XAttribute
Attributes must be cloneable.

Specified by:
clone in interface XAttribute
Overrides:
clone in class Object
Returns:
A clone of this attribute.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(XAttribute o)
Specified by:
compareTo in interface Comparable<XAttribute>