org.unisens
Interface Entry

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
AnnotationEntry, CustomEntry, EventEntry, MeasurementEntry, SignalEntry, TimedEntry, ValuesEntry

public interface Entry
extends java.lang.Cloneable

An Entry is a structural unit of a unisens dataset. Entry is the base class of the following Entries:

Author:
Joerg Ottenbacher, Radi Nedkov, Malte Kirst

Method Summary
 void addCustomAttribute(java.lang.String key, java.lang.String value)
          Add a ned custom attributes to this unisens entry.
 Entry clone()
           
 void close()
          Closes the data file associated with this Entry
 BinFileFormat createBinFileFormat()
          Creates a new BinFileFormat object.
 CsvFileFormat createCsvFileFormat()
          Creates a new CsvFileFormat object.
 CustomFileFormat createCustomFileFormat(java.lang.String fileFormatName)
          Creates a new CustomFileFormat object.
 XmlFileFormat createXmlFileFormat()
          Creates a new XmlFileFormat object.
 java.lang.String getComment()
          Gets the comment of this Entry.
 java.lang.String getContentClass()
          Gets an identifier of the content class of the data contained in this Entry.
 java.util.HashMap<java.lang.String,java.lang.String> getCustomAttributes()
          Returns the custom attributes of this unisens entry.
 FileFormat getFileFormat()
          Gets the file format that is used to represet this Entry in the associated data file
 java.lang.String getId()
          Gets the id of this Entry.
 java.lang.String getName()
          Gets the name of this Entry.
 java.lang.String getSource()
          Gets the source of this Entry.
 java.lang.String getSourceId()
          Gets the source id of this Entry.
 Unisens getUnisens()
          Gets the unisens object which contains this Entry
 void rename(java.lang.String newId)
          Rename this Entry.
 void setComment(java.lang.String comment)
          Sets the comment of this Entry.
 void setContentClass(java.lang.String theClass)
          Sets the content class of the data contained in this Entry.
 void setFileFormat(FileFormat fileFormat)
          Sets the file format that is used to represet this Entry in the associated data file
 void setName(java.lang.String name)
          Sets the name of this Entry.
 void setSource(java.lang.String source)
          Sets the source of this Entry.
 void setSourceId(java.lang.String sourceId)
          Sets the source id of this Entry.
 void setUnisens(Unisens unisens)
          Set the unisens object which contains this Entry
 

Method Detail

getComment

java.lang.String getComment()
Gets the comment of this Entry.

Returns:
the comment

getId

java.lang.String getId()
Gets the id of this Entry. The id is unique for all Entries in a unsiens dataset.

Returns:
the id of this Entry

getName

java.lang.String getName()
Gets the name of this Entry.

Returns:
the name of this Entry

getSourceId

java.lang.String getSourceId()
Gets the source id of this Entry. The source id can be used to describe origin of data contained in an Entry. For example a device serial number or MAC adress.

Returns:
the source id of this Entry

getSource

java.lang.String getSource()
Gets the source of this Entry. The source can be used to comment the origin of data contained in an Entry. For example the name of the measurement device.

Returns:
the source of this Entry

getContentClass

java.lang.String getContentClass()
Gets an identifier of the content class of the data contained in this Entry. Recommended content classes are listed in the unisens documentation.

Returns:
the content class of this Entry

setName

void setName(java.lang.String name)
Sets the name of this Entry.

Parameters:
name - of the entry

setContentClass

void setContentClass(java.lang.String theClass)
Sets the content class of the data contained in this Entry. Recommended content classes are listed in the unisens documentation.

Parameters:
theClass - the content class

setComment

void setComment(java.lang.String comment)
Sets the comment of this Entry.

Parameters:
comment - the comment

rename

void rename(java.lang.String newId)
            throws java.io.IOException,
                   DuplicateIdException
Rename this Entry. Also the data file containing the assiciated data will be renamed.

Parameters:
newId - the new id of this Entry
Throws:
java.io.IOException
DuplicateIdException

setSourceId

void setSourceId(java.lang.String sourceId)
Sets the source id of this Entry. The source id can be used to describe origin of data contained in an Entry. For example a device serial number or MAC adress.

Parameters:
sourceId - the source id of this Entry

setSource

void setSource(java.lang.String source)
Sets the source of this Entry. The source can be used to comment the origin of data contained in an Entry.

Parameters:
source - the source of this Entry

getCustomAttributes

java.util.HashMap<java.lang.String,java.lang.String> getCustomAttributes()
Returns the custom attributes of this unisens entry. Custom attributes can be used to add simple context information as key/values pairs.

Returns:
all custom attribues as HashMap

addCustomAttribute

void addCustomAttribute(java.lang.String key,
                        java.lang.String value)
Add a ned custom attributes to this unisens entry. Custom attributes can be used to add simple context information as key/values pairs.

Parameters:
key - the key of the new attribute
value - the value of the new attribute

getFileFormat

FileFormat getFileFormat()
Gets the file format that is used to represet this Entry in the associated data file

Returns:
the file format of this Entry

setFileFormat

void setFileFormat(FileFormat fileFormat)
Sets the file format that is used to represet this Entry in the associated data file

Parameters:
fileFormat - the file format of this Entry

getUnisens

Unisens getUnisens()
Gets the unisens object which contains this Entry

Returns:
the unisend object

setUnisens

void setUnisens(Unisens unisens)
Set the unisens object which contains this Entry


close

void close()
Closes the data file associated with this Entry


clone

Entry clone()

createBinFileFormat

BinFileFormat createBinFileFormat()
Creates a new BinFileFormat object.

Returns:
new BinFileFormat object

createCsvFileFormat

CsvFileFormat createCsvFileFormat()
Creates a new CsvFileFormat object.

Returns:
new CsvFileFormat object

createXmlFileFormat

XmlFileFormat createXmlFileFormat()
Creates a new XmlFileFormat object.

Returns:
new XmlFileFormat object

createCustomFileFormat

CustomFileFormat createCustomFileFormat(java.lang.String fileFormatName)
Creates a new CustomFileFormat object.

Parameters:
fileFormatName - the name of the CustomFileFormat
Returns:
new CustomFileFormat object