SMILA (incubation) API documentation

org.eclipse.smila.datamodel.record.impl
Class MObjectImpl

java.lang.Object
  extended by org.eclipse.smila.datamodel.record.impl.AnnotatableImpl
      extended by org.eclipse.smila.datamodel.record.impl.AttributeValueImpl
          extended by org.eclipse.smila.datamodel.record.impl.MObjectImpl
All Implemented Interfaces:
java.io.Serializable, Annotatable, AttributeValue, MObject

public class MObjectImpl
extends AttributeValueImpl
implements MObject

Default implementation of SMILA Metadata Objects.

Author:
jschumacher
See Also:
Serialized Form

Constructor Summary
MObjectImpl()
           
 
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 class org.eclipse.smila.datamodel.record.impl.AttributeValueImpl
getSemanticType, setSemanticType
 
Methods inherited from class org.eclipse.smila.datamodel.record.impl.AnnotatableImpl
addAnnotation, annotationsSize, getAnnotation, getAnnotationNames, getAnnotations, hasAnnotation, hasAnnotations, removeAnnotations, removeAnnotations, setAnnotation, setAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 

Constructor Detail

MObjectImpl

public MObjectImpl()
Method Detail

getAttribute

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

Specified by:
getAttribute in interface MObject
Parameters:
name - name of an attribute.
Returns:
an Attribute object if an attribute of this name exists, else null.
See Also:
MObject.getAttribute(java.lang.String)

getAttributeNames

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

Specified by:
getAttributeNames in interface MObject
Returns:
iterator on attributes names.
See Also:
MObject.getAttributeNames()

hasAttribute

public 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.

Specified by:
hasAttribute in interface MObject
Parameters:
name - name of attribute to check for
Returns:
true if an attribute exists with this name, else false.
See Also:
MObject.hasAttribute(java.lang.String)

hasAttributes

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

Specified by:
hasAttributes in interface MObject
Returns:
true if attributes are set, else false.
See Also:
MObject.hasAttributes()

setAttribute

public 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.

Specified by:
setAttribute in interface MObject
Parameters:
name - name of attribute to set
attribute - new Attribute object.
See Also:
MObject.setAttribute(java.lang.String, org.eclipse.smila.datamodel.record.Attribute)

size

public int size()
get number of attributes.

Specified by:
size in interface MObject
Returns:
number of attributes.
See Also:
MObject.size()

removeAttribute

public 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.

Specified by:
removeAttribute in interface MObject
Parameters:
name - name of attribute to remove
Returns:
the removed Attribute object or null
See Also:
MObject.removeAttribute(java.lang.String)

SMILA (incubation) API documentation