@Platform(include="<nix/Source.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 Source extends EntityWithMetadata
The Source is conceptually a rather simple entity. It is used to note the provenance of the data and offers the opportunity to bind additional metadata. One special feature of the Source is the possibility to contain other sources as children thus building up a tree of sources. This can, for example, be used to specify that a source electrode array contains multiple electrodes as its child sources.
Constructor and Description |
---|
Source()
Constructor that creates an uninitialized Source.
|
Modifier and Type | Method and Description |
---|---|
Source |
createSource(String name,
String type)
Create a new root source.
|
boolean |
deleteSource(Source source)
Delete a root source and all its child sources from
the source.
|
boolean |
deleteSource(String nameOrId)
Delete a root source and all its child sources from
the source.
|
List<Source> |
findSources()
Get all descendant sources of the source recursively.
|
List<Source> |
findSources(int maxDepth)
Get all descendant sources of the source recursively.
|
List<Source> |
findSources(java.util.function.Predicate<Source> filter)
Get all descendant sources of the source recursively.
|
List<Source> |
findSources(java.util.function.Predicate<Source> filter,
int maxDepth)
Get all descendant sources of the source recursively.
|
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 source.
|
String |
getDefinition()
Getter for the definition of the source.
|
String |
getId()
Get id of the source.
|
Section |
getMetadata()
Get metadata associated with this entity.
|
String |
getName()
Getter for the name of the source.
|
Source |
getSource(long index)
Retrieves a specific source by index.
|
Source |
getSource(String nameOrId)
Retrieves a specific child source that is a direct descendant.
|
long |
getSourceCount()
Returns the number of sources that are direct descendants of this source.
|
List<Source> |
getSources()
Get all direct child sources associated with this source.
|
List<Source> |
getSources(java.util.function.Predicate<Source> filter)
Get all direct child sources associated with this source.
|
String |
getType()
Getter for the type of the source.
|
Date |
getUpdatedAt()
Get the date of the last update.
|
boolean |
hasSource(Source source)
Checks if this source has a specific source as direct descendant.
|
boolean |
hasSource(String nameOrId)
Checks if this source has a specific source as direct descendant.
|
boolean |
isNone()
Check if entity is null
|
void |
removeMetadata()
Removes metadata associated with the entity.
|
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 source.
|
void |
setMetadata(Section metadata)
Associate the entity with some metadata.
|
void |
setMetadata(String id)
Associate the entity with some metadata.
|
void |
setType(String type)
Setter for the type of the source.
|
void |
setUpdatedAt()
Sets the time of the last update to the current time if the field is not set.
|
String |
toString() |
compareTo
isInitialized
public Source()
Calling any method on an uninitialized source will throw a RuntimeException
.
@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 source.@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 sourcepublic 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
@Cast(value="bool") public boolean hasSource(@StdString String nameOrId)
nameOrId
- The name or id of the source.@Cast(value="bool") public boolean hasSource(@Const @ByRef Source source)
source
- The Source.public Source getSource(String nameOrId)
nameOrId
- The name or id of the source.public Source getSource(long index)
index
- The index of the source.@Name(value="sourceCount") public long getSourceCount()
public List<Source> getSources()
public List<Source> getSources(java.util.function.Predicate<Source> filter)
The parameter filter can be used to filter sources by various criteria.
filter
- A filter function.public List<Source> findSources(java.util.function.Predicate<Source> filter, int maxDepth)
This method traverses the sub-tree of all child sources of the source. The traversal is accomplished via breadth first and can be limited in depth. On each node or source a filter is applied. If the filter returns true the respective source will be added to the result list.
filter
- A filter function.maxDepth
- The maximum depth of traversal.public List<Source> findSources(java.util.function.Predicate<Source> filter)
This method traverses the sub-tree of all child sources of the source. The traversal is accomplished via breadth first and can be limited in depth. On each node or source a filter is applied. If the filter returns true the respective source will be added to the result list. By default nodes at all depths are considered.
filter
- A filter function.public List<Source> findSources(int maxDepth)
This method traverses the sub-tree of all child sources of the source. The traversal is accomplished via breadth first and can be limited in depth. On each node or source a filter is applied. If the filter returns true the respective source will be added to the result list. By default a filter is used that accepts all sources.
maxDepth
- The maximum depth of traversal.public List<Source> findSources()
This method traverses the sub-tree of all child sources of the source. The traversal is accomplished via breadth first and can be limited in depth. On each node or source a filter is applied. If the filter returns true the respective source will be added to the result list. By default a filter is used that accepts all sources at all depths.
public Source createSource(String name, String type)
name
- The name of the source to create.type
- The type of the source.@Cast(value="bool") public boolean deleteSource(@StdString String nameOrId)
nameOrId
- The name or id of the source to remove.@Cast(value="bool") public boolean deleteSource(@Const @ByRef Source source)
source
- The Source to delete.public String toString()
toString
in class org.bytedeco.javacpp.Pointer
Copyright © 2016. All rights reserved.