Package org.graphstream.stream
Class AttributePipe
java.lang.Object
org.graphstream.stream.SourceBase
org.graphstream.stream.PipeBase
org.graphstream.stream.AttributePipe
- All Implemented Interfaces:
AttributeSink,ElementSink,Pipe,Sink,Source
public class AttributePipe extends PipeBase
Allows to filter the attribute event stream.
The filtering is based on attribute predicates. An attribute predicate is an
object that you provide and that only defines one method
AttributePredicate.matches(String, Object). If the "matches()" method
return false, the attribute is discarded from the event stream, else it is
passed to the listeners of this filter.
You can setup a predicate from all attributes (graph, node and edge attributes) and specific predicates for graph, node and edge attributes.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.graphstream.stream.SourceBase
SourceBase.ElementType -
Constructor Summary
Constructors Constructor Description AttributePipe() -
Method Summary
Modifier and Type Method Description voidedgeAttributeAdded(String graphId, long timeId, String edgeId, String attribute, Object value)A edge attribute was added.voidedgeAttributeChanged(String graphId, long timeId, String edgeId, String attribute, Object oldValue, Object newValue)A edge attribute was changed.voidedgeAttributeRemoved(String graphId, long timeId, String edgeId, String attribute)A edge attribute was removed.AttributePredicategetEdgeAttributeFilter()The filter for all edge attributes.AttributePredicategetGlobalAttributeFilter()The filter for all graph, node and edge attributes.AttributePredicategetGraphAttributeFilter()The filter for all graph attributes.AttributePredicategetNodeAttributeFilter()The filter for all node attributes.voidgraphAttributeAdded(String graphId, long timeId, String attribute, Object value)A graph attribute was added.voidgraphAttributeChanged(String graphId, long timeId, String attribute, Object oldValue, Object newValue)A graph attribute was changed.voidgraphAttributeRemoved(String graphId, long timeId, String attribute)A graph attribute was removed.voidnodeAttributeAdded(String graphId, long timeId, String nodeId, String attribute, Object value)A node attribute was added.voidnodeAttributeChanged(String graphId, long timeId, String nodeId, String attribute, Object oldValue, Object newValue)A node attribute was changed.voidnodeAttributeRemoved(String graphId, long timeId, String nodeId, String attribute)A node attribute was removed.voidsetEdgeAttributeFilter(AttributePredicate filter)Set an attribute filter for edge attributes only (graph an node attributes are not filtered by this filter).voidsetGlobalAttributeFilter(AttributePredicate filter)Set an attribute filter for graph, node and edge attributes.voidsetGraphAttributeFilter(AttributePredicate filter)Set an attribute filter for graph attributes only (node an edge attributes are not filtered by this filter).voidsetNodeAttributeFilter(AttributePredicate filter)Set an attribute filter for node attributes only (graph an edge attributes are not filtered by this filter).Methods inherited from class org.graphstream.stream.PipeBase
edgeAdded, edgeRemoved, graphCleared, nodeAdded, nodeRemoved, stepBeginsMethods inherited from class org.graphstream.stream.SourceBase
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, removeAttributeSink, removeElementSink, removeSink, sendAttributeChangedEvent, sendAttributeChangedEvent, sendEdgeAdded, sendEdgeAdded, sendEdgeAttributeAdded, sendEdgeAttributeAdded, sendEdgeAttributeChanged, sendEdgeAttributeChanged, sendEdgeAttributeRemoved, sendEdgeAttributeRemoved, sendEdgeRemoved, sendEdgeRemoved, sendGraphAttributeAdded, sendGraphAttributeAdded, sendGraphAttributeChanged, sendGraphAttributeChanged, sendGraphAttributeRemoved, sendGraphAttributeRemoved, sendGraphCleared, sendGraphCleared, sendNodeAdded, sendNodeAdded, sendNodeAttributeAdded, sendNodeAttributeAdded, sendNodeAttributeChanged, sendNodeAttributeChanged, sendNodeAttributeRemoved, sendNodeAttributeRemoved, sendNodeRemoved, sendNodeRemoved, sendStepBegins, sendStepBeginsMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graphstream.stream.Source
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
-
Constructor Details
-
AttributePipe
public AttributePipe()
-
-
Method Details
-
setGlobalAttributeFilter
Set an attribute filter for graph, node and edge attributes. If the filter is null, attributes will not be filtered globally.- Parameters:
filter- The filter to use, it can be null to disable global attribute filtering.
-
setGraphAttributeFilter
Set an attribute filter for graph attributes only (node an edge attributes are not filtered by this filter). If the filter is null, graph attributes will not be filtered.- Parameters:
filter- The filter to use, it can be null to disable graph attribute filtering.
-
setNodeAttributeFilter
Set an attribute filter for node attributes only (graph an edge attributes are not filtered by this filter). If the filter is null, node attributes will not be filtered.- Parameters:
filter- The filter to use, it can be null to disable node attribute filtering.
-
setEdgeAttributeFilter
Set an attribute filter for edge attributes only (graph an node attributes are not filtered by this filter). If the filter is null, edge attributes will not be filtered.- Parameters:
filter- The filter to use, it can be null to disable edge attribute filtering.
-
getGlobalAttributeFilter
The filter for all graph, node and edge attributes. This filter can be null.- Returns:
- The global attribute filter or null if there is no global filter.
-
getGraphAttributeFilter
The filter for all graph attributes. This filter can be null.- Returns:
- The graph attribute filter or null if there is no graph filter.
-
getNodeAttributeFilter
The filter for all node attributes. This filter can be null.- Returns:
- The node global attribute filter or null if there is no node filter.
-
getEdgeAttributeFilter
The filter for all edge attributes. This filter can be null.- Returns:
- The edge attribute filter or null of there is no edge filter.
-
edgeAttributeAdded
public void edgeAttributeAdded(String graphId, long timeId, String edgeId, String attribute, Object value)Description copied from interface:AttributeSinkA edge attribute was added.- Specified by:
edgeAttributeAddedin interfaceAttributeSink- Overrides:
edgeAttributeAddedin classPipeBase- Parameters:
graphId- Identifier of the graph where the change occurred.edgeId- Identifier of the edge whose attribute changed.attribute- The attribute name.value- The attribute new value.
-
edgeAttributeChanged
public void edgeAttributeChanged(String graphId, long timeId, String edgeId, String attribute, Object oldValue, Object newValue)Description copied from interface:AttributeSinkA edge attribute was changed.- Specified by:
edgeAttributeChangedin interfaceAttributeSink- Overrides:
edgeAttributeChangedin classPipeBase- Parameters:
graphId- Identifier of the graph where the change occurred.edgeId- Identifier of the edge whose attribute changed.attribute- The attribute name.oldValue- The attribute old value.newValue- The attribute new value.
-
edgeAttributeRemoved
Description copied from interface:AttributeSinkA edge attribute was removed.- Specified by:
edgeAttributeRemovedin interfaceAttributeSink- Overrides:
edgeAttributeRemovedin classPipeBase- Parameters:
graphId- Identifier of the graph where the attribute was removed.edgeId- Identifier of the edge whose attribute was removed.attribute- The removed attribute name.
-
graphAttributeAdded
Description copied from interface:AttributeSinkA graph attribute was added.- Specified by:
graphAttributeAddedin interfaceAttributeSink- Overrides:
graphAttributeAddedin classPipeBase- Parameters:
graphId- Identifier of the graph where the attribute changed.attribute- The attribute name.value- The attribute new value.
-
graphAttributeChanged
public void graphAttributeChanged(String graphId, long timeId, String attribute, Object oldValue, Object newValue)Description copied from interface:AttributeSinkA graph attribute was changed.- Specified by:
graphAttributeChangedin interfaceAttributeSink- Overrides:
graphAttributeChangedin classPipeBase- Parameters:
graphId- Identifier of the graph where the attribute changed.attribute- The attribute name.oldValue- The attribute old value.newValue- The attribute new value.
-
graphAttributeRemoved
Description copied from interface:AttributeSinkA graph attribute was removed.- Specified by:
graphAttributeRemovedin interfaceAttributeSink- Overrides:
graphAttributeRemovedin classPipeBase- Parameters:
graphId- Identifier of the graph where the attribute was removed.attribute- The removed attribute name.
-
nodeAttributeAdded
public void nodeAttributeAdded(String graphId, long timeId, String nodeId, String attribute, Object value)Description copied from interface:AttributeSinkA node attribute was added.- Specified by:
nodeAttributeAddedin interfaceAttributeSink- Overrides:
nodeAttributeAddedin classPipeBase- Parameters:
graphId- Identifier of the graph where the change occurred.nodeId- Identifier of the node whose attribute changed.attribute- The attribute name.value- The attribute new value.
-
nodeAttributeChanged
public void nodeAttributeChanged(String graphId, long timeId, String nodeId, String attribute, Object oldValue, Object newValue)Description copied from interface:AttributeSinkA node attribute was changed.- Specified by:
nodeAttributeChangedin interfaceAttributeSink- Overrides:
nodeAttributeChangedin classPipeBase- Parameters:
graphId- Identifier of the graph where the change occurred.nodeId- Identifier of the node whose attribute changed.attribute- The attribute name.oldValue- The attribute old value.newValue- The attribute new value.
-
nodeAttributeRemoved
Description copied from interface:AttributeSinkA node attribute was removed.- Specified by:
nodeAttributeRemovedin interfaceAttributeSink- Overrides:
nodeAttributeRemovedin classPipeBase- Parameters:
graphId- Identifier of the graph where the attribute was removed.nodeId- Identifier of the node whose attribute was removed.attribute- The removed attribute name.
-