Package org.deckfour.xes.model.impl
Class XAttributeImpl
- java.lang.Object
-
- org.deckfour.xes.model.impl.XAttributeImpl
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<XAttribute>,XAttributable,XAttribute
- Direct Known Subclasses:
XAttributeBooleanImpl,XAttributeContinuousImpl,XAttributeDiscreteImpl,XAttributeIDImpl,XAttributeLiteralImpl,XAttributeTimestampImpl
public abstract class XAttributeImpl extends java.lang.Object implements XAttribute
This class implements the abstract base class for strongly-typed attributes.- Author:
- Christian W. Guenther (christian@deckfour.org)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedXAttributeImpl(java.lang.String key)Creates a new, empty attribute.protectedXAttributeImpl(java.lang.String key, XExtension extension)Creates a new attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(XVisitor visitor, XAttributable parent)java.lang.Objectclone()Attributes must be cloneable.intcompareTo(XAttribute o)booleanequals(java.lang.Object obj)XAttributeMapgetAttributes()Retrieves the attributes set for this element.XExtensiongetExtension()Retrieves the extension defining this attribute.java.util.Set<XExtension>getExtensions()Retrieves the extensions used by this element, i.e.java.lang.StringgetKey()Retrieves the key, i.e.booleanhasAttributes()Checks for the existence of attributes.inthashCode()voidsetAttributes(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
-
Methods inherited from interface org.deckfour.xes.model.XAttribute
toString
-
-
-
-
Constructor Detail
-
XAttributeImpl
protected XAttributeImpl(java.lang.String key)
Creates a new, empty attribute.- Parameters:
key- The key, i.e. unique name identifier, of this attribute.
-
XAttributeImpl
protected XAttributeImpl(java.lang.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 java.lang.String getKey()
Description copied from interface:XAttributeRetrieves the key, i.e. unique identifier, of this attribute.- Specified by:
getKeyin interfaceXAttribute- Returns:
- The key of this attribute, as a string.
-
getExtension
public XExtension getExtension()
Description copied from interface:XAttributeRetrieves the extension defining this attribute.- Specified by:
getExtensionin interfaceXAttribute- 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:XAttributableRetrieves the attributes set for this element.- Specified by:
getAttributesin interfaceXAttributable- Returns:
- A map of attributes.
-
setAttributes
public void setAttributes(XAttributeMap attributes)
Description copied from interface:XAttributableSets the map of attributes for this element.- Specified by:
setAttributesin interfaceXAttributable- Parameters:
attributes- A map of attributes.
-
hasAttributes
public boolean hasAttributes()
Description copied from interface:XAttributableChecks for the existence of attributes. This method can be a more efficient way of checking for the existance of attributes than usingXAttributable.getAttributes()in certain situations.- Specified by:
hasAttributesin interfaceXAttributable- Returns:
- whether this element has any attributes
-
getExtensions
public java.util.Set<XExtension> getExtensions()
Description copied from interface:XAttributableRetrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself.- Specified by:
getExtensionsin interfaceXAttributable- Returns:
- A set of extensions.
-
clone
public java.lang.Object clone()
Description copied from interface:XAttributeAttributes must be cloneable.- Specified by:
clonein interfaceXAttribute- Overrides:
clonein classjava.lang.Object- Returns:
- A clone of this attribute.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(XAttribute o)
- Specified by:
compareToin interfacejava.lang.Comparable<XAttribute>
-
accept
public void accept(XVisitor visitor, XAttributable parent)
- Specified by:
acceptin interfaceXAttribute
-
-