@Platform(include="<nix/Tag.hpp>") @Platform(value="linux",link="nix@.1",preload="hdf5@.7") @Platform(value="windows",link="nix",preload={"hdf5","msvcp120","msvcr120","szip","zlib"}) @Namespace(value="nix") public class Tag extends EntityWithSources
Besides the DataArray
the tag entities can be considered as the other
core entities of the data model.
They are meant to attach annotations directly to the data and to establish meaningful
links between different kinds of stored data.
Most importantly tags allow the definition of points or regions of interest in data
that is stored in other DataArray
entities. The data array entities the
tag applies to are defined by its property getReferences(Predicate)
.
Further the referenced data is defined by an origin vector called getPosition()
and an optional getExtent()
vector that defines its size.
Therefore position and extent of a tag, together with the references field
defines a group of points or regions of interest collected from a subset of all
available DataArray
entities.
Further tags have a field called getFeatures()
which makes it possible to associate
other data with the tag. Semantically a feature of a tag is some additional data that
contains additional information about the points of hyperslabs defined by the tag.
This could be for example data that represents a stimulus (e.g. an image or a
signal) that was applied in a certain interval during the recording.
Constructor and Description |
---|
Tag()
Constructor that creates an uninitialized Tag.
|
Modifier and Type | Method and Description |
---|---|
void |
addReference(DataArray reference)
Add a DataArray to the list of referenced data of the tag.
|
void |
addReference(String id)
Add a DataArray to the list of referenced data of the tag.
|
void |
addSource(Source source)
Associate a new source with the entity.
|
void |
addSource(String id)
Associate a new source with the entity.
|
Feature |
createFeature(DataArray data,
int linkType)
Create a new feature.
|
Feature |
createFeature(String dataArrayId,
int linkType)
Create a new feature.
|
boolean |
deleteFeature(Feature feature)
Deletes a feature from the tag.
|
boolean |
deleteFeature(String id)
Deletes a feature from the tag.
|
void |
forceCreatedAt(Date date)
Sets the creation date to the provided value even if the attribute is set.
|
void |
forceUpdatedAt()
Sets the time of the last update to the current time.
|
Date |
getCreatedAt()
Get the creation date of the tag.
|
String |
getDefinition()
Getter for the definition of the tag.
|
double[] |
getExtent()
Gets the extent of a tag.
|
Feature |
getFeature(long index)
Retrieves a specific feature from the tag.
|
Feature |
getFeature(String id)
Retrieves a specific feature from the tag.
|
long |
getFeatureCount()
Gets the number of features in this block.
|
List<Feature> |
getFeatures()
Get all Features of this tag.
|
List<Feature> |
getFeatures(java.util.function.Predicate<Feature> filter)
Get all Features of this tag.
|
String |
getId()
Get id of the tag.
|
Section |
getMetadata()
Get metadata associated with this entity.
|
String |
getName()
Getter for the name of the tag.
|
double[] |
getPosition()
Gets the position of a tag.
|
DataArray |
getReference(long index)
Gets a referenced DataArray by its index.
|
DataArray |
getReference(String id)
Gets a specific referenced DataArray from the tag.
|
long |
getReferenceCount()
Gets the number of referenced DataArray entities of the tag.
|
List<DataArray> |
getReferences()
Get all referenced data arrays associated with this tag.
|
List<DataArray> |
getReferences(java.util.function.Predicate<DataArray> filter)
Get referenced data arrays associated with this tag.
|
Source |
getSource(long index)
Retrieves an associated source identified by its index.
|
Source |
getSource(String id)
Returns an associated source identified by its id.
|
long |
getSourceCount()
Get the number of sources associated with this entity.
|
List<Source> |
getSources()
Get all sources associated with this entity.
|
String |
getType()
Getter for the type of the tag.
|
List<String> |
getUnits()
Gets the units of the tag.
|
Date |
getUpdatedAt()
Get the date of the last update.
|
boolean |
hasFeature(Feature feature)
Checks if a specific feature exists on the tag.
|
boolean |
hasFeature(String id)
Checks if a specific feature exists on the tag.
|
boolean |
hasReference(DataArray reference)
Checks whether a DataArray is referenced by the tag.
|
boolean |
hasReference(String id)
Checks whether a DataArray is referenced by the tag.
|
boolean |
hasSource(Source source)
Checks if a specific source is associated with this entity.
|
boolean |
hasSource(String id)
Checks if a specific source is associated with this entity.
|
boolean |
isNone()
Check if entity is null
|
void |
removeMetadata()
Removes metadata associated with the entity.
|
boolean |
removeReference(DataArray reference)
Remove a DataArray from the list of referenced data of the tag.
|
boolean |
removeReference(String id)
Remove a DataArray from the list of referenced data of the tag.
|
boolean |
removeSource(Source source)
Remove a source from the list of associated sources.
|
boolean |
removeSource(String id)
Remove a source from the list of associated sources.
|
DataView |
retrieveData(long referenceIndex)
Returns the data associated with a certain reference.
|
DataView |
retrieveFeatureData(long featureIndex)
Returns the data stored in the selected Feature.
|
void |
setCreatedAt()
Sets the creation time to the current time if the field is not set.
|
void |
setDefinition(String definition)
Setter for the definition of the tag.
|
void |
setExtent(double[] extent)
Sets the extent of a tag.
|
void |
setMetadata(Section metadata)
Associate the entity with some metadata.
|
void |
setMetadata(String id)
Associate the entity with some metadata.
|
void |
setPosition(double[] position)
Sets the position of a tag.
|
void |
setReferences(List<DataArray> references)
Sets all referenced DataArray entities.
|
void |
setSources(List<Source> sources)
Set all sources associations for this entity.
|
void |
setType(String type)
Setter for the type of the tag.
|
void |
setUnits(List<String> units)
Sets the units of a tag.
|
void |
setUpdatedAt()
Sets the time of the last update to the current time if the field is not set.
|
String |
toString() |
compareTo
isInitialized
public Tag()
Calling any method on an uninitialized Tag will throw a RuntimeException
exception.
@Cast(value="bool") public boolean isNone()
ImplContainer
isNone
in class ImplContainer
@Name(value="id") @StdString public String getId()
public Date getCreatedAt()
getCreatedAt
in class Entity
public Date getUpdatedAt()
getUpdatedAt
in class Entity
public void setUpdatedAt()
setUpdatedAt
in class Entity
public void forceUpdatedAt()
forceUpdatedAt
in class Entity
public void setCreatedAt()
setCreatedAt
in class Entity
public void forceCreatedAt(Date date)
forceCreatedAt
in class Entity
date
- The creation date to set.@Name(value="type") public void setType(@StdString String type)
setType
in class NamedEntity
type
- The type of the tag.@Name(value="type") @StdString public String getType()
getType
in class NamedEntity
@Name(value="name") @StdString public String getName()
getName
in class NamedEntity
public void setDefinition(String definition)
setDefinition
in class NamedEntity
definition
- definition of tag.public String getDefinition()
getDefinition
in class NamedEntity
@Name(value="metadata") public Section getMetadata()
getMetadata
in class EntityWithMetadata
Section
@Name(value="metadata") public void setMetadata(@Const @ByRef Section metadata)
Calling this method will replace previously stored information.
setMetadata
in class EntityWithMetadata
metadata
- The Section
that should be associated
with this entity.Section
@Name(value="metadata") public void setMetadata(@StdString String id)
Calling this method will replace previously stored information.
setMetadata
in class EntityWithMetadata
id
- The id of the Section
that should be associated
with this entity.Section
public void removeMetadata()
removeMetadata
in class EntityWithMetadata
Section
@Name(value="sourceCount") public long getSourceCount()
getSourceCount
in class EntityWithSources
Source
@Cast(value="bool") public boolean hasSource(@StdString String id)
hasSource
in class EntityWithSources
id
- The source id to check.Source
@Cast(value="bool") public boolean hasSource(@Const @ByRef Source source)
hasSource
in class EntityWithSources
source
- The source to check.Source
public Source getSource(String id)
getSource
in class EntityWithSources
id
- The id of the associated source.Source
public Source getSource(long index)
getSource
in class EntityWithSources
index
- The index of the associated source.Source
public List<Source> getSources()
getSources
in class EntityWithSources
Source
public void setSources(List<Source> sources)
All previously existing associations will be overwritten.
setSources
in class EntityWithSources
sources
- A vector with all sources.Source
public void addSource(@StdString String id)
If a source with the given id already is associated with the entity, the call will have no effect.
addSource
in class EntityWithSources
id
- The id of the source.Source
public void addSource(@Const @ByRef Source source)
Calling this method will have no effect if the source is already associated to this entity.
addSource
in class EntityWithSources
source
- The source to add.Source
@Cast(value="bool") public boolean removeSource(@StdString String id)
This method just removes the association between the entity and the source. The source itself will not be deleted from the file.
removeSource
in class EntityWithSources
id
- The id of the source to remove.Source
@Cast(value="bool") public boolean removeSource(@Const @ByRef Source source)
This method just removes the association between the entity and the source. The source itself will not be deleted from the file.
removeSource
in class EntityWithSources
source
- The source to remove.Source
public List<String> getUnits()
The units are applied to all values for position and extent in order to calculate the right position vectors in referenced data arrays.
public void setUnits(List<String> units)
units
- All units as a list. If null removes the units.public double[] getPosition()
The position is a vector that points into referenced DataArrays.
@Name(value="position") public void setPosition(@StdVector double[] position)
position
- The position vector list.public double[] getExtent()
Given a specified position vector, the extent vector defined the size of a region of interest in the referenced DataArray entities.
public void setExtent(double[] extent)
extent
- The extent vector list.@Cast(value="bool") public boolean hasReference(@StdString String id)
id
- The id of the DataArray to check.DataArray
@Cast(value="bool") public boolean hasReference(@Const @ByRef DataArray reference)
reference
- The DataArray to check.DataArray
@Name(value="referenceCount") public long getReferenceCount()
DataArray
public DataArray getReference(String id)
id
- The id of the referenced DataArray.DataArray
public DataArray getReference(long index)
index
- The index of the DataArray.DataArray
public void addReference(@Const @ByRef DataArray reference)
reference
- The DataArray to add.DataArray
public void addReference(@StdString String id)
id
- The id of the DataArray to add.DataArray
@Cast(value="bool") public boolean removeReference(@Const @ByRef DataArray reference)
This method just removes the association between the data array and the tag, the data array itself will not be removed from the file.
reference
- The DataArray to remove.DataArray
@Cast(value="bool") public boolean removeReference(@StdString String id)
This method just removes the association between the data array and the tag, the data array itself will not be removed from the file.
id
- The id of the DataArray to remove.DataArray
public List<DataArray> getReferences()
Always uses filter that accepts all sources.
DataArray
public List<DataArray> getReferences(java.util.function.Predicate<DataArray> filter)
The parameter filter can be used to filter data arrays by various criteria.
filter
- A filter function.DataArray
public void setReferences(List<DataArray> references)
Previously referenced data arrays, that are not in the references vector will be removed.
references
- All referenced arrays.DataArray
@Cast(value="bool") public boolean hasFeature(@StdString String id)
id
- The id of a feature.Feature
@Cast(value="bool") public boolean hasFeature(@Const @ByRef Feature feature)
feature
- The Feature to check.Feature
@Name(value="featureCount") public long getFeatureCount()
Feature
public Feature getFeature(String id)
id
- The id of the feature.Feature
public Feature getFeature(long index)
index
- The index of the feature.Feature
public List<Feature> getFeatures()
Feature
public List<Feature> getFeatures(java.util.function.Predicate<Feature> filter)
The parameter filter can be used to filter features by various criteria.
filter
- A filter function.Feature
public Feature createFeature(DataArray data, int linkType)
data
- The data array of this feature.linkType
- The link type of this feature.Feature
public Feature createFeature(String dataArrayId, int linkType)
dataArrayId
- The id of the data array of this feature.linkType
- The link type of this feature.Feature
@Cast(value="bool") public boolean deleteFeature(@StdString String id)
id
- The id of the feature to remove.Feature
@Cast(value="bool") public boolean deleteFeature(@Const @ByRef Feature feature)
feature
- The feature to remove.Feature
@ByVal public DataView retrieveData(@Cast(value="size_t") long referenceIndex)
referenceIndex
- The index of the reference of which
the data should be returned.DataView
@ByVal public DataView retrieveFeatureData(@Cast(value="size_t") long featureIndex)
featureIndex
- The index of the requested feature.DataView
public String toString()
toString
in class org.bytedeco.javacpp.Pointer
Copyright © 2016. All rights reserved.