public class ImportContainerImpl extends Object implements Container, ContainerLoader, ContainerUnloader
Container.Factory| Constructor and Description |
|---|
ImportContainerImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(EdgeDraft edgeDraft)
Adds an edge to this container.
|
ColumnDraft |
addEdgeColumn(String key,
Class typeClass)
Adds a new edge column to this container.
|
ColumnDraft |
addEdgeColumn(String key,
Class typeClass,
boolean dynamic)
Adds a new dynamic edge column to this container.
|
void |
addNode(NodeDraft nodeDraft)
Adds a node to this container.
|
ColumnDraft |
addNodeColumn(String key,
Class typeClass)
Adds a new node column to this container.
|
ColumnDraft |
addNodeColumn(String key,
Class typeClass,
boolean dynamic)
Adds a new dynamic node column to this container.
|
boolean |
allowAutoNode() |
boolean |
allowParallelEdges() |
boolean |
allowSelfLoop() |
void |
closeLoader()
Close the current loading and clean content before unloading.
|
boolean |
edgeExists(String id)
Returns
true if an edge exists with the given
id. |
boolean |
edgeExists(String source,
String target)
Returns
true if an edge exists from source to
target. |
ElementFactoryImpl |
factory()
Returns the factory for building nodes and edges instances.
|
EdgeDraft |
getEdge(String id)
Returns the edge with the given
id, or null if
not found. |
ColumnDraft |
getEdgeColumn(String key)
Returns the edge column draft with
key as identifier. |
Iterable<ColumnDraft> |
getEdgeColumns() |
int |
getEdgeCount() |
EdgeDirectionDefault |
getEdgeDefault() |
Iterable<EdgeDraft> |
getEdges() |
EdgeMergeStrategy |
getEdgesMergeStrategy() |
Class |
getEdgeTypeLabelClass() |
ElementIdType |
getElementIdType() |
org.gephi.graph.api.Interval |
getInterval() |
ContainerLoader |
getLoader()
Gets the container loading interface.
|
NodeDraftImpl |
getNode(String id)
Returns the node with the given
id, or create a new node
with this id if not found. |
ColumnDraft |
getNodeColumn(String key)
Returns the node column draft with
key as identifier. |
Iterable<ColumnDraft> |
getNodeColumns() |
int |
getNodeCount() |
Iterable<NodeDraft> |
getNodes() |
Report |
getReport()
Returns the report associated to this container, if it exists.
|
String |
getSource()
If exists, returns the source of the data.
|
org.gephi.graph.api.TimeFormat |
getTimeFormat() |
org.gephi.graph.api.TimeRepresentation |
getTimeRepresentation()
Gets the current time representation, either
TIMESTAMP or
INTERVAL. |
Double |
getTimestamp() |
org.joda.time.DateTimeZone |
getTimeZone() |
ContainerUnloader |
getUnloader()
Get the container unloading interface.
|
boolean |
hasDynamicAttributes()
Returns true if this container contains elements that have dynamic
attributes.
|
boolean |
hasEdgeColumn(String key) |
boolean |
hasNodeColumn(String key) |
boolean |
hasSelfLoops()
Returns true if edges in this container are self-loops.
|
boolean |
isAutoScale() |
boolean |
isDynamicGraph()
Returns true if this container contains a dynamic graph.
|
boolean |
isFillLabelWithId() |
boolean |
isMultiGraph()
Returns true if this container contains a multigraph.
|
boolean |
nodeExists(String id)
Returns
true if a node exists with the given
id. |
void |
removeEdge(EdgeDraft edgeDraft)
Removes an edge from this container.
|
void |
setAllowAutoNode(boolean value) |
void |
setAllowParallelEdge(boolean value) |
void |
setAllowSelfLoop(boolean value) |
void |
setAutoScale(boolean autoscale) |
void |
setEdgeDefault(EdgeDirectionDefault edgeDefault)
Set edge default type: DIRECTED, UNDIRECTED or
MIXED.
|
void |
setEdgesMergeStrategy(EdgeMergeStrategy edgesMergeStrategy) |
void |
setElementIdType(ElementIdType type)
Sets the type of the id for elements.
|
void |
setFillLabelWithId(boolean value) |
void |
setInterval(String startDateTime,
String endDateTime)
Sets the interval for the entire graph.
|
void |
setReport(Report report)
Sets a report this container can use to report issues detected when
loading the container.
|
void |
setSource(String source)
Sets the source of the data put in the container.
|
void |
setTimeFormat(org.gephi.graph.api.TimeFormat timeFormat)
Sets the current Time Format for dynamic data, either
DATE,
DATETIME or DOUBLE. |
void |
setTimeRepresentation(org.gephi.graph.api.TimeRepresentation timeRepresentation)
Sets the current time representation, either
TIMESTAMP or
INTERVAL. |
void |
setTimestamp(String timestamp)
Sets the timestamp for the entire graph.
|
void |
setTimeZone(org.joda.time.DateTimeZone timeZone)
Sets the time zone that is used to parse date and time.
|
boolean |
verify()
This method must be called after the loading is complete and before
unloading.
|
public ContainerLoader getLoader()
ContainerThe loader is used by modules which put data in the container, whereas the unloader interface is used by modules which read containers content.
public ContainerUnloader getUnloader()
ContainerThe unloader interface is used by modules which read containers content, whereas the loader is used for pushing data in the container.
getUnloader in interface Containerpublic ElementFactoryImpl factory()
ContainerLoaderfactory in interface ContainerLoaderpublic void setSource(String source)
Containerpublic String getSource()
ContainergetSource in interface ContainergetSource in interface ContainerUnloadernull if source is not
defined.public void addNode(NodeDraft nodeDraft)
ContainerLoaderaddNode in interface ContainerLoadernodeDraft - node that is to be pushed to this containerpublic NodeDraftImpl getNode(String id)
ContainerLoaderid, or create a new node
with this id if not found.getNode in interface ContainerLoaderid - node identifierpublic boolean nodeExists(String id)
ContainerLoadertrue if a node exists with the given
id.nodeExists in interface ContainerLoaderid - node identifiertrue if node exists, false otherwisepublic boolean edgeExists(String source, String target)
ContainerLoadertrue if an edge exists from source to
target.edgeExists in interface ContainerLoadersource - edge source nodetarget - edge target nodetrue if edges exists, false otherwisepublic void addEdge(EdgeDraft edgeDraft)
ContainerLoaderedgeDraft.addEdge in interface ContainerLoaderedgeDraft - edge that is to be pushed to this containerpublic void removeEdge(EdgeDraft edgeDraft)
ContainerLoaderremoveEdge in interface ContainerLoaderedgeDraft - edge that is to be removed from this containerpublic boolean edgeExists(String id)
ContainerLoadertrue if an edge exists with the given
id.edgeExists in interface ContainerLoaderid - an edge identifiertrue if edge exists, false otherwisepublic EdgeDraft getEdge(String id)
ContainerLoaderid, or null if
not found.getEdge in interface ContainerLoaderid - edge identifierid as an identifier, or null
if not foundpublic Iterable<NodeDraft> getNodes()
getNodes in interface ContainerUnloaderpublic int getNodeCount()
getNodeCount in interface ContainerUnloaderpublic Iterable<EdgeDraft> getEdges()
getEdges in interface ContainerUnloaderpublic int getEdgeCount()
getEdgeCount in interface ContainerUnloaderpublic org.gephi.graph.api.TimeFormat getTimeFormat()
getTimeFormat in interface ContainerUnloaderpublic void setTimeFormat(org.gephi.graph.api.TimeFormat timeFormat)
ContainerLoaderDATE,
DATETIME or DOUBLE. It configures how the dates
are formatted.
The default value is DOUBLE.
setTimeFormat in interface ContainerLoadertimeFormat - time formatpublic org.gephi.graph.api.TimeRepresentation getTimeRepresentation()
ContainerLoaderTIMESTAMP or
INTERVAL.
getTimeRepresentation in interface ContainerLoadergetTimeRepresentation in interface ContainerUnloaderpublic void setTimeRepresentation(org.gephi.graph.api.TimeRepresentation timeRepresentation)
ContainerLoaderTIMESTAMP or
INTERVAL.
The default value is INTERVAL.
setTimeRepresentation in interface ContainerLoadertimeRepresentation - time representationpublic org.joda.time.DateTimeZone getTimeZone()
getTimeZone in interface ContainerUnloaderpublic void setTimeZone(org.joda.time.DateTimeZone timeZone)
ContainerLoaderIf not set, the local time zone is used.
setTimeZone in interface ContainerLoadertimeZone - time zonepublic ColumnDraft addNodeColumn(String key, Class typeClass)
ContainerLoaderIf a column with this key already exists, it is ignored and return the existing column.
addNodeColumn in interface ContainerLoaderkey - node column identifiertypeClass - node column typepublic ColumnDraft addNodeColumn(String key, Class typeClass, boolean dynamic)
ContainerLoaderDynamic attributes have values over time.
If a column with this key already exists, it is ignored and return the existing column.
addNodeColumn in interface ContainerLoaderkey - node column identifiertypeClass - node column typedynamic - true if the column needs to be dynamic, false otherwisepublic ColumnDraft addEdgeColumn(String key, Class typeClass)
ContainerLoaderIf a column with this key already exists, it is ignored and return the existing column.
addEdgeColumn in interface ContainerLoaderkey - edge column identifiertypeClass - edge column typepublic ColumnDraft addEdgeColumn(String key, Class typeClass, boolean dynamic)
ContainerLoaderDynamic attributes have values over time.
If a column with this key already exists, it is ignored and return the existing column.
addEdgeColumn in interface ContainerLoaderkey - edge column identifiertypeClass - edge column typedynamic - true if the column needs to be dynamic, false otherwisepublic ColumnDraft getNodeColumn(String key)
ContainerLoaderkey as identifier.getNodeColumn in interface ContainerLoadergetNodeColumn in interface ContainerUnloaderkey - node column keypublic boolean hasNodeColumn(String key)
hasNodeColumn in interface ContainerUnloaderpublic ColumnDraft getEdgeColumn(String key)
ContainerLoaderkey as identifier.getEdgeColumn in interface ContainerLoadergetEdgeColumn in interface ContainerUnloaderkey - edge column keypublic boolean hasEdgeColumn(String key)
hasEdgeColumn in interface ContainerUnloaderpublic Iterable<ColumnDraft> getNodeColumns()
getNodeColumns in interface ContainerUnloaderpublic Iterable<ColumnDraft> getEdgeColumns()
getEdgeColumns in interface ContainerUnloaderpublic void setTimestamp(String timestamp)
ContainerLoadersetTimestamp in interface ContainerLoadertimestamp - timestamppublic void setInterval(String startDateTime, String endDateTime)
ContainerLoadersetInterval in interface ContainerLoaderstartDateTime - interval startendDateTime - interval endpublic org.gephi.graph.api.Interval getInterval()
getInterval in interface ContainerUnloaderpublic Double getTimestamp()
getTimestamp in interface ContainerUnloaderpublic void setElementIdType(ElementIdType type)
ContainerLoadersetElementIdType in interface ContainerLoadertype - id typepublic ElementIdType getElementIdType()
getElementIdType in interface ContainerUnloaderpublic boolean verify()
ContainerIt aims to verify data consistency as a whole.
public void closeLoader()
ContainercloseLoader in interface Containerpublic boolean isDynamicGraph()
ContainerA dynamic graph has elements that appear or disappear over time.
isDynamicGraph in interface Containerpublic boolean hasDynamicAttributes()
ContainerDynamic attributes are attributes with different values over time.
hasDynamicAttributes in interface Containerpublic Report getReport()
Containerpublic void setReport(Report report)
ContainerReport are used to log info and issues during import process. Only one report can be associated to a container.
public boolean allowAutoNode()
allowAutoNode in interface ContainerUnloaderpublic boolean allowParallelEdges()
allowParallelEdges in interface ContainerUnloaderpublic boolean allowSelfLoop()
allowSelfLoop in interface ContainerUnloaderpublic boolean isFillLabelWithId()
isFillLabelWithId in interface ContainerUnloaderpublic EdgeMergeStrategy getEdgesMergeStrategy()
getEdgesMergeStrategy in interface ContainerUnloaderpublic EdgeDirectionDefault getEdgeDefault()
getEdgeDefault in interface ContainerUnloaderpublic boolean isMultiGraph()
ContainerA multi-graph is a graph that has several types of edges (i.e. edges with different labels).
isMultiGraph in interface Containerpublic boolean hasSelfLoops()
ContainerhasSelfLoops in interface Containerpublic void setAllowAutoNode(boolean value)
setAllowAutoNode in interface ContainerLoaderpublic void setAllowParallelEdge(boolean value)
setAllowParallelEdge in interface ContainerLoaderpublic void setAllowSelfLoop(boolean value)
setAllowSelfLoop in interface ContainerLoaderpublic void setFillLabelWithId(boolean value)
setFillLabelWithId in interface ContainerLoaderpublic void setEdgeDefault(EdgeDirectionDefault edgeDefault)
ContainerLoadersetEdgeDefault in interface ContainerLoaderedgeDefault - edge default type valuepublic boolean isAutoScale()
isAutoScale in interface ContainerUnloaderpublic void setAutoScale(boolean autoscale)
setAutoScale in interface ContainerLoaderpublic void setEdgesMergeStrategy(EdgeMergeStrategy edgesMergeStrategy)
setEdgesMergeStrategy in interface ContainerLoaderpublic Class getEdgeTypeLabelClass()
getEdgeTypeLabelClass in interface ContainerUnloaderCopyright © 2007–2017. All rights reserved.