SMILA (incubation) API documentation

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

java.lang.Object
  extended by org.eclipse.smila.datamodel.record.impl.AnnotatableImpl
      extended by org.eclipse.smila.datamodel.record.impl.AttributeImpl
All Implemented Interfaces:
java.io.Serializable, Annotatable, Attribute

public class AttributeImpl
extends AnnotatableImpl
implements Attribute

Default implementation of SMILA Attribute.

Author:
jschumacher
See Also:
Serialized Form

Constructor Summary
AttributeImpl()
           
 
Method Summary
 void addLiteral(Literal literal)
          add a literal value to this attribute.
 void addObject(MObject object)
          add a metadata object to this attribute.
 Literal getLiteral()
          get one literal value of this attribute.
 java.util.List<Literal> getLiterals()
          get list of literal values in this attribute.
 java.lang.String getName()
          get name of attribute.
 MObject getObject()
          get one metadata object of this attribute.
 java.util.List<MObject> getObjects()
          get metadata objects contained in this attribute.
 boolean hasLiterals()
          check if attribute has literal values.
 boolean hasObjects()
          check if attribute has sub metadata objects.
 int literalSize()
          get number of literal values.
 int objectSize()
          get number of metadata objects in this attribute.
 void removeLiterals()
          remove all current literal values from this attribute.
 void removeObjects()
          remove all current metadata objects from this attribute.
 void setLiteral(Literal literal)
          set a single literal value for this attribute.
 void setLiterals(java.util.Collection<? extends Literal> literals)
          set the literal values of this attribute.
 void setName(java.lang.String name)
          set name of attribute.
 void setObject(MObject object)
          set the metadata object of this attribute.
 void setObjects(java.util.Collection<? extends MObject> objects)
          set the metadata objects of this attribute.
 
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.Annotatable
addAnnotation, annotationsSize, getAnnotation, getAnnotationNames, getAnnotations, hasAnnotation, hasAnnotations, removeAnnotations, removeAnnotations, setAnnotation, setAnnotations
 

Constructor Detail

AttributeImpl

public AttributeImpl()
Method Detail

addObject

public void addObject(MObject object)
add a metadata object to this attribute. The object is appended to the current collection of objects.

Specified by:
addObject in interface Attribute
Parameters:
object - new metadata object
See Also:
Attribute.addObject(org.eclipse.smila.datamodel.record.MObject)

addLiteral

public void addLiteral(Literal literal)
add a literal value to this attribute. The value is appended to the current collection of values.

Specified by:
addLiteral in interface Attribute
Parameters:
literal - new literal value.
See Also:
Attribute.addLiteral(org.eclipse.smila.datamodel.record.Literal)

getName

public java.lang.String getName()
get name of attribute.

Specified by:
getName in interface Attribute
Returns:
name of attribute
See Also:
Attribute.getName()

getObject

public MObject getObject()
get one metadata object of this attribute. To be used as a conventience methods when a client can be sure that the attribute contains at most one metadata object because an implementation of the data model might not be able to ensure that the order of lmetadata objects is the same each time the record is accessed.

Specified by:
getObject in interface Attribute
Returns:
a single literal value if any are contained, else null.
See Also:
Attribute.getObject()

getObjects

public java.util.List<MObject> getObjects()
get metadata objects contained in this attribute.

Specified by:
getObjects in interface Attribute
Returns:
contained metadata objects.
See Also:
Attribute.getObjects()

getLiteral

public Literal getLiteral()
get one literal value of this attribute. To be used as a conventience methods when a client can be sure that the attribute contains at most one literal value because an implementation of the data model might not be able to ensure that the order of literal values is the same each time the record is accessed.

Specified by:
getLiteral in interface Attribute
Returns:
a single literal value if any are contained, else null.
See Also:
Attribute.getLiteral()

getLiterals

public java.util.List<Literal> getLiterals()
get list of literal values in this attribute.

Specified by:
getLiterals in interface Attribute
Returns:
list of literal values of this attribute. null, if attribute does not have literal values.
See Also:
Attribute.getLiterals()

hasObjects

public boolean hasObjects()
check if attribute has sub metadata objects.

Specified by:
hasObjects in interface Attribute
Returns:
true if attributes contains metadata objects, else false
See Also:
Attribute.hasObjects()

hasLiterals

public boolean hasLiterals()
check if attribute has literal values.

Specified by:
hasLiterals in interface Attribute
Returns:
true if attribute has literal values, else false
See Also:
Attribute.hasLiterals()

objectSize

public int objectSize()
get number of metadata objects in this attribute.

Specified by:
objectSize in interface Attribute
Returns:
number of metadata objects.
See Also:
Attribute.objectSize()

removeObjects

public void removeObjects()
remove all current metadata objects from this attribute.

Specified by:
removeObjects in interface Attribute
See Also:
Attribute.removeObjects()

removeLiterals

public void removeLiterals()
remove all current literal values from this attribute.

Specified by:
removeLiterals in interface Attribute
See Also:
Attribute.removeLiterals()

setName

public void setName(java.lang.String name)
set name of attribute.

Specified by:
setName in interface Attribute
Parameters:
name - name of attribute
See Also:
Attribute.setName(java.lang.String)

setObject

public void setObject(MObject object)
set the metadata object of this attribute. All currently existing objects are replaced.

Specified by:
setObject in interface Attribute
Parameters:
object - new metadata object
See Also:
Attribute.setObject(org.eclipse.smila.datamodel.record.MObject)

setObjects

public void setObjects(java.util.Collection<? extends MObject> objects)
set the metadata objects of this attribute. All currently existing objects are replaced.

Specified by:
setObjects in interface Attribute
Parameters:
objects - new metadata objects
See Also:
Attribute.setObjects(java.util.Collection)

setLiteral

public void setLiteral(Literal literal)
set a single literal value for this attribute. All currently existing values are replaced.

Specified by:
setLiteral in interface Attribute
Parameters:
literal - new literal value
See Also:
Attribute.setLiteral(org.eclipse.smila.datamodel.record.Literal)

setLiterals

public void setLiterals(java.util.Collection<? extends Literal> literals)
set the literal values of this attribute. All currently existing values are replaced.

Specified by:
setLiterals in interface Attribute
Parameters:
literals - new literal values
See Also:
Attribute.setLiterals(java.util.Collection)

literalSize

public int literalSize()
get number of literal values.

Specified by:
literalSize in interface Attribute
Returns:
number of literal values.
See Also:
Attribute.literalSize()

SMILA (incubation) API documentation