SMILA (incubation) API documentation

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

java.lang.Object
  extended by org.eclipse.smila.datamodel.record.impl.RecordImpl
All Implemented Interfaces:
java.io.Serializable, Record

public class RecordImpl
extends java.lang.Object
implements Record, java.io.Serializable

Default implementation of SMILA Records.

Author:
jschumacher
See Also:
Serialized Form

Field Summary
static RecordFactory FACTORY
          record factory for this record implementation.
 
Constructor Summary
RecordImpl()
           
 
Method Summary
 int attachmentSize()
          get number of attachments.
 byte[] getAttachment(java.lang.String name)
          get attachment value for the specified name.
 java.util.Iterator<java.lang.String> getAttachmentNames()
          Get iterator on names of attachments of this record.
 RecordFactory getFactory()
          get record factory to use for adding objects to this record.
 Id getId()
          Get the ID of this record.
 MObject getMetadata()
          Get the metadata object of this record.
 boolean hasAttachment(java.lang.String name)
          check if this record has an attachment of the specified name.
 boolean hasAttachments()
          check if this record has attachments.
 void removeAttachment(java.lang.String name)
          remove attachment for specified name.
 void removeAttachments()
          remove attachments.
 void setAttachment(java.lang.String name, byte[] attachment)
          set attachment value for the specified name.
 void setId(Id id)
          Set the ID of this record.
 void setMetadata(MObject metadata)
          Set the metadata object of this record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY

public static final RecordFactory FACTORY
record factory for this record implementation.

Constructor Detail

RecordImpl

public RecordImpl()
Method Detail

getFactory

public RecordFactory getFactory()
get record factory to use for adding objects to this record.

Specified by:
getFactory in interface Record
Returns:
record factory for this record.
See Also:
Record.getFactory()

attachmentSize

public int attachmentSize()
get number of attachments.

Specified by:
attachmentSize in interface Record
Returns:
number of attachments.
See Also:
Record.attachmentSize()

getAttachment

public byte[] getAttachment(java.lang.String name)
get attachment value for the specified name.

Specified by:
getAttachment in interface Record
Parameters:
name - attachment name.
Returns:
attachment value.
See Also:
Record.getAttachment(java.lang.String)

getAttachmentNames

public java.util.Iterator<java.lang.String> getAttachmentNames()
Get iterator on names of attachments of this record. Returns empty iterator if record has no attachments.

Specified by:
getAttachmentNames in interface Record
Returns:
iterator on attachment names.
See Also:
Record.getAttachmentNames()

getId

public Id getId()
Get the ID of this record.

Specified by:
getId in interface Record
Returns:
record ID
See Also:
Record.getId()

getMetadata

public MObject getMetadata()
Get the metadata object of this record. Contains attributes and annotations about this record.

Specified by:
getMetadata in interface Record
Returns:
the metadata object describing this record.
See Also:
Record.getMetadata()

hasAttachments

public boolean hasAttachments()
check if this record has attachments.

Specified by:
hasAttachments in interface Record
Returns:
true if this record has attachments, else false.
See Also:
Record.hasAttachments()

hasAttachment

public boolean hasAttachment(java.lang.String name)
check if this record has an attachment of the specified name.

Specified by:
hasAttachment in interface Record
Parameters:
name - attachment name.
Returns:
true if this record has an attachment for this name, else false.
See Also:
Record.hasAttachment(java.lang.String)

removeAttachment

public void removeAttachment(java.lang.String name)
remove attachment for specified name.

Specified by:
removeAttachment in interface Record
Parameters:
name - attachment name.
See Also:
Record.removeAttachment(java.lang.String)

removeAttachments

public void removeAttachments()
remove attachments.

Specified by:
removeAttachments in interface Record
See Also:
Record.removeAttachments()

setAttachment

public void setAttachment(java.lang.String name,
                          byte[] attachment)
set attachment value for the specified name.

Specified by:
setAttachment in interface Record
Parameters:
name - attachment name.
attachment - attachment value.
See Also:
org.eclipse.smila.datamodel.record.Record#setAttachment(java.lang.String, java.io.Serializable)

setId

public void setId(Id id)
Set the ID of this record.

Specified by:
setId in interface Record
Parameters:
id - new record ID
See Also:
Record.setId(org.eclipse.smila.datamodel.id.Id)

setMetadata

public void setMetadata(MObject metadata)
Set the metadata object of this record.

Specified by:
setMetadata in interface Record
Parameters:
metadata - new metadata object describing this record.
See Also:
Record.setMetadata(org.eclipse.smila.datamodel.record.MObject)

SMILA (incubation) API documentation