SMILA (incubation) API documentation

org.eclipse.smila.datamodel.record
Interface Attribute

All Superinterfaces:
Annotatable
All Known Implementing Classes:
AttributeImpl

public interface Attribute
extends Annotatable

Interface of Attribute object. Attributes have a name and are part of Metadata Objects. They can contain a set of literal values and a set of further metadata object.

Author:
jschumacher
See Also:
MObject

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 interface org.eclipse.smila.datamodel.record.Annotatable
addAnnotation, annotationsSize, getAnnotation, getAnnotationNames, getAnnotations, hasAnnotation, hasAnnotations, removeAnnotations, removeAnnotations, setAnnotation, setAnnotations
 

Method Detail

getName

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

Returns:
name of attribute

setName

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

Parameters:
name - name of attribute

hasLiterals

boolean hasLiterals()
check if attribute has literal values.

Returns:
true if attribute has literal values, else false

literalSize

int literalSize()
get number of literal values.

Returns:
number of literal values.

getLiterals

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

Returns:
list of literal values of this attribute. null, if attribute does not have literal values.

getLiteral

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.

Returns:
a single literal value if any are contained, else null.

setLiterals

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

Parameters:
literals - new literal values

setLiteral

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

Parameters:
literal - new literal value

addLiteral

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

Parameters:
literal - new literal value.

removeLiterals

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


hasObjects

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

Returns:
true if attributes contains metadata objects, else false

objectSize

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

Returns:
number of metadata objects.

getObjects

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

Returns:
contained metadata objects.

getObject

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.

Returns:
a single literal value if any are contained, else null.

setObjects

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

Parameters:
objects - new metadata objects

setObject

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

Parameters:
object - new metadata object

addObject

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

Parameters:
object - new metadata object

removeObjects

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


SMILA (incubation) API documentation