SMILA (incubation) API documentation

org.eclipse.smila.datamodel.record
Interface MObject

All Superinterfaces:
Annotatable, AttributeValue
All Known Implementing Classes:
MObjectImpl

public interface MObject
extends AttributeValue

Interface of Metadata Objects. Metadata Objects consist of a set of attributes and can have annotations. The root metadata object of an SMILA record is a Metadata Object, but Metadata objects can also be used as attribute values inside other metadata objects to create more structured records. The interface name is MObject (= Metadata Object) in order to avoid the name clash with java.lang.Object.

Author:
jschumacher

Method Summary
 Attribute getAttribute(java.lang.String name)
          Get the attribute object for the specified name.
 java.util.Iterator<java.lang.String> getAttributeNames()
          Get an iterator on the names of the currently existing attributes.
 boolean hasAttribute(java.lang.String name)
          Check if this metadata object has an attribute with the specified name.
 boolean hasAttributes()
          Check if this metadata object has attributes set.
 Attribute removeAttribute(java.lang.String name)
          Removes the attribute object for the specified name.
 void setAttribute(java.lang.String name, Attribute attribute)
          Set the attribute object for the specified name.
 int size()
          get number of attributes.
 
Methods inherited from interface org.eclipse.smila.datamodel.record.AttributeValue
getSemanticType, setSemanticType
 
Methods inherited from interface org.eclipse.smila.datamodel.record.Annotatable
addAnnotation, annotationsSize, getAnnotation, getAnnotationNames, getAnnotations, hasAnnotation, hasAnnotations, removeAnnotations, removeAnnotations, setAnnotation, setAnnotations
 

Method Detail

hasAttributes

boolean hasAttributes()
Check if this metadata object has attributes set. Existing attributes do not imply that they have already values or annotations.

Returns:
true if attributes are set, else false.

hasAttribute

boolean hasAttribute(java.lang.String name)
Check if this metadata object has an attribute with the specified name. The existence of an attribute does not imply that it has values or annotations yet.

Parameters:
name - name of attribute to check for
Returns:
true if an attribute exists with this name, else false.

size

int size()
get number of attributes.

Returns:
number of attributes.

getAttributeNames

java.util.Iterator<java.lang.String> getAttributeNames()
Get an iterator on the names of the currently existing attributes.

Returns:
iterator on attributes names.

getAttribute

Attribute getAttribute(java.lang.String name)
Get the attribute object for the specified name.

Parameters:
name - name of an attribute.
Returns:
an Attribute object if an attribute of this name exists, else null.

setAttribute

void setAttribute(java.lang.String name,
                  Attribute attribute)
Set the attribute object for the specified name. If the attribute has been set before, the old attribute is replaced by the new one.

Parameters:
name - name of attribute to set
attribute - new Attribute object.

removeAttribute

Attribute removeAttribute(java.lang.String name)
Removes the attribute object for the specified name. If no attribute with the given name exists null is returned.

Parameters:
name - name of attribute to remove
Returns:
the removed Attribute object or null

SMILA (incubation) API documentation