Package org.gephi.io.importer.api
Interface ContainerLoader
-
public interface ContainerLoader
Interface for loading aContainer
with graph and attributes data from an importer.Data pushed to a container are not directly appended to the main graph structure and
Processor
are doing this job.Use the draft factory for getting
NodeDraft
andEdgeDraft
instances.- Author:
- Mathieu Bastian
- See Also:
Importer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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
edgeExists(String id)
Returnstrue
if an edge exists with the givenid
.boolean
edgeExists(String source, String target)
Returnstrue
if an edge exists fromsource
totarget
.ElementDraft.Factory
factory()
Returns the factory for building nodes and edges instances.EdgeDraft
getEdge(String id)
Returns the edge with the givenid
, ornull
if not found.ColumnDraft
getEdgeColumn(String key)
Returns the edge column draft withkey
as identifier.NodeDraft
getNode(String id)
Returns the node with the givenid
, or create a new node with this id if not found.ColumnDraft
getNodeColumn(String key)
Returns the node column draft withkey
as identifier.TimeRepresentation
getTimeRepresentation()
Gets the current time representation, eitherTIMESTAMP
orINTERVAL
.boolean
nodeExists(String id)
Returnstrue
if a node exists with the givenid
.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 start, String end)
Sets the interval for the entire graph.void
setTimeFormat(TimeFormat timeFormat)
Sets the current Time Format for dynamic data, eitherDATE
,DATETIME
orDOUBLE
.void
setTimeRepresentation(TimeRepresentation timeRepresentation)
Sets the current time representation, eitherTIMESTAMP
orINTERVAL
.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.
-
-
-
Method Detail
-
addEdge
void addEdge(EdgeDraft edgeDraft)
Adds an edge to this container. The edge must have source and target defined. If the edge already exist, it is ignored. Source and target nodes must be added to the container before pushingedgeDraft
.- Parameters:
edgeDraft
- edge that is to be pushed to this container
-
addNode
void addNode(NodeDraft nodeDraft)
Adds a node to this container. Identified by its id. If no id is present, a unique identifier is generated.- Parameters:
nodeDraft
- node that is to be pushed to this container
-
removeEdge
void removeEdge(EdgeDraft edgeDraft)
Removes an edge from this container. Do nothing if the edge is not in the container.- Parameters:
edgeDraft
- edge that is to be removed from this container
-
getNode
NodeDraft getNode(String id)
Returns the node with the givenid
, or create a new node with this id if not found.- Parameters:
id
- node identifier- Returns:
- found node, or a new default node
-
nodeExists
boolean nodeExists(String id)
Returnstrue
if a node exists with the givenid
.- Parameters:
id
- node identifier- Returns:
true
if node exists,false
otherwise
-
getEdge
EdgeDraft getEdge(String id)
Returns the edge with the givenid
, ornull
if not found.- Parameters:
id
- edge identifier- Returns:
- edge with
id
as an identifier, ornull
if not found
-
edgeExists
boolean edgeExists(String id)
Returnstrue
if an edge exists with the givenid
.- Parameters:
id
- an edge identifier- Returns:
true
if edge exists,false
otherwise
-
edgeExists
boolean edgeExists(String source, String target)
Returnstrue
if an edge exists fromsource
totarget
.- Parameters:
source
- edge source nodetarget
- edge target node- Returns:
true
if edges exists,false
otherwise
-
setEdgeDefault
void setEdgeDefault(EdgeDirectionDefault edgeDefault)
Set edge default type: DIRECTED, UNDIRECTED or MIXED. Default value is directed.- Parameters:
edgeDefault
- edge default type value
-
getNodeColumn
ColumnDraft getNodeColumn(String key)
Returns the node column draft withkey
as identifier.- Parameters:
key
- node column key- Returns:
- column draft or null if not found
-
getEdgeColumn
ColumnDraft getEdgeColumn(String key)
Returns the edge column draft withkey
as identifier.- Parameters:
key
- edge column key- Returns:
- column draft or null if not found
-
addNodeColumn
ColumnDraft addNodeColumn(String key, Class typeClass)
Adds a new node column to this container.If a column with this key already exists, it is ignored and return the existing column.
- Parameters:
key
- node column identifiertypeClass
- node column type- Returns:
- column draft
-
addEdgeColumn
ColumnDraft addEdgeColumn(String key, Class typeClass)
Adds a new edge column to this container.If a column with this key already exists, it is ignored and return the existing column.
- Parameters:
key
- edge column identifiertypeClass
- edge column type- Returns:
- column draft
-
addNodeColumn
ColumnDraft addNodeColumn(String key, Class typeClass, boolean dynamic)
Adds a new dynamic node column to this container.Dynamic attributes have values over time.
If a column with this key already exists, it is ignored and return the existing column.
- Parameters:
key
- node column identifiertypeClass
- node column typedynamic
- true if the column needs to be dynamic, false otherwise- Returns:
- column draft
-
addEdgeColumn
ColumnDraft addEdgeColumn(String key, Class typeClass, boolean dynamic)
Adds a new dynamic edge column to this container.Dynamic attributes have values over time.
If a column with this key already exists, it is ignored and return the existing column.
- Parameters:
key
- edge column identifiertypeClass
- edge column typedynamic
- true if the column needs to be dynamic, false otherwise- Returns:
- column draft
-
factory
ElementDraft.Factory factory()
Returns the factory for building nodes and edges instances.- Returns:
- the draft factory
-
setTimeFormat
void setTimeFormat(TimeFormat timeFormat)
Sets the current Time Format for dynamic data, eitherDATE
,DATETIME
orDOUBLE
. It configures how the dates are formatted.The default value is
DOUBLE
.- Parameters:
timeFormat
- time format
-
setTimestamp
void setTimestamp(String timestamp)
Sets the timestamp for the entire graph. All elements and all dynamic columns will automatically receive this timestamp when the graph is processed.- Parameters:
timestamp
- timestamp
-
setInterval
void setInterval(String start, String end)
Sets the interval for the entire graph. All elements and all dynamic columns will automatically receive this interval when the graph is processed.- Parameters:
start
- interval startend
- interval end
-
setElementIdType
void setElementIdType(ElementIdType type)
Sets the type of the id for elements.- Parameters:
type
- id type
-
getTimeRepresentation
TimeRepresentation getTimeRepresentation()
Gets the current time representation, eitherTIMESTAMP
orINTERVAL
.- Returns:
- time representation
-
setTimeRepresentation
void setTimeRepresentation(TimeRepresentation timeRepresentation)
Sets the current time representation, eitherTIMESTAMP
orINTERVAL
.The default value is
INTERVAL
.- Parameters:
timeRepresentation
- time representation
-
setTimeZone
void setTimeZone(org.joda.time.DateTimeZone timeZone)
Sets the time zone that is used to parse date and time.If not set, the local time zone is used.
- Parameters:
timeZone
- time zone
-
setAllowSelfLoop
void setAllowSelfLoop(boolean value)
-
setAllowAutoNode
void setAllowAutoNode(boolean value)
-
setAllowParallelEdge
void setAllowParallelEdge(boolean value)
-
setAutoScale
void setAutoScale(boolean autoscale)
-
setFillLabelWithId
void setFillLabelWithId(boolean value)
-
setEdgesMergeStrategy
void setEdgesMergeStrategy(EdgeMergeStrategy edgesMergeStrategy)
-
-