Package org.neo4j.gds.api
Class LabeledIdMap
- java.lang.Object
-
- org.neo4j.gds.api.LabeledIdMap
-
- All Implemented Interfaces:
BatchNodeIterable
,IdMap
,NodeIterator
,PartialIdMap
- Direct Known Subclasses:
ArrayIdMap
,FilteredLabeledIdMap
public abstract class LabeledIdMap extends java.lang.Object implements IdMap
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.BatchNodeIterable
BatchNodeIterable.BitSetIdIterator, BatchNodeIterable.IdIterable, BatchNodeIterable.IdIterator
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.IdMap
IdMap.NodeLabelConsumer
-
-
Field Summary
Fields Modifier and Type Field Description protected LabelInformation
labelInformation
-
Fields inherited from interface org.neo4j.gds.api.IdMap
NO_TYPE, NOT_FOUND, START_NODE_ID
-
-
Constructor Summary
Constructors Constructor Description LabeledIdMap(LabelInformation labelInformation, long nodeCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNodeIdToLabel(long nodeId, org.neo4j.gds.NodeLabel nodeLabel)
Assigns a node to the given node label.void
addNodeLabel(org.neo4j.gds.NodeLabel nodeLabel)
Adds new node label to the available node labels.java.util.Set<org.neo4j.gds.NodeLabel>
availableNodeLabels()
java.util.Collection<org.neo4j.gds.collections.primitive.PrimitiveLongIterable>
batchIterables(long batchSize)
void
forEachNode(java.util.function.LongPredicate consumer)
Iterate over each nodeIdvoid
forEachNodeLabel(long mappedNodeId, IdMap.NodeLabelConsumer consumer)
boolean
hasLabel(long mappedNodeId, org.neo4j.gds.NodeLabel label)
LabelInformation
labelInformation()
long
nodeCount()
Number of mapped nodeIds.long
nodeCount(org.neo4j.gds.NodeLabel nodeLabel)
Number of mapped nodeIds for a specific node label.java.util.PrimitiveIterator.OfLong
nodeIterator()
java.util.PrimitiveIterator.OfLong
nodeIterator(java.util.Set<org.neo4j.gds.NodeLabel> labels)
java.util.List<org.neo4j.gds.NodeLabel>
nodeLabels(long mappedNodeId)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.neo4j.gds.api.IdMap
containsOriginalId, highestOriginalId, rootIdMap, safeToMappedNodeId, toOriginalNodeId, toRootNodeId, typeId, withFilteredLabels
-
Methods inherited from interface org.neo4j.gds.api.PartialIdMap
rootNodeCount, toMappedNodeId
-
-
-
-
Field Detail
-
labelInformation
protected LabelInformation labelInformation
-
-
Constructor Detail
-
LabeledIdMap
public LabeledIdMap(LabelInformation labelInformation, long nodeCount)
-
-
Method Detail
-
labelInformation
public LabelInformation labelInformation()
-
nodeCount
public long nodeCount()
Description copied from interface:IdMap
Number of mapped nodeIds.
-
nodeCount
public long nodeCount(org.neo4j.gds.NodeLabel nodeLabel)
Description copied from interface:IdMap
Number of mapped nodeIds for a specific node label.
-
forEachNode
public void forEachNode(java.util.function.LongPredicate consumer)
Description copied from interface:NodeIterator
Iterate over each nodeId- Specified by:
forEachNode
in interfaceNodeIterator
-
nodeIterator
public java.util.PrimitiveIterator.OfLong nodeIterator()
- Specified by:
nodeIterator
in interfaceNodeIterator
-
nodeIterator
public java.util.PrimitiveIterator.OfLong nodeIterator(java.util.Set<org.neo4j.gds.NodeLabel> labels)
- Specified by:
nodeIterator
in interfaceNodeIterator
-
batchIterables
public java.util.Collection<org.neo4j.gds.collections.primitive.PrimitiveLongIterable> batchIterables(long batchSize)
- Specified by:
batchIterables
in interfaceBatchNodeIterable
- Returns:
- a collection of iterables over every node, partitioned by the given batch size.
-
availableNodeLabels
public java.util.Set<org.neo4j.gds.NodeLabel> availableNodeLabels()
- Specified by:
availableNodeLabels
in interfaceIdMap
-
nodeLabels
public java.util.List<org.neo4j.gds.NodeLabel> nodeLabels(long mappedNodeId)
- Specified by:
nodeLabels
in interfaceIdMap
-
forEachNodeLabel
public void forEachNodeLabel(long mappedNodeId, IdMap.NodeLabelConsumer consumer)
- Specified by:
forEachNodeLabel
in interfaceIdMap
-
hasLabel
public boolean hasLabel(long mappedNodeId, org.neo4j.gds.NodeLabel label)
-
addNodeLabel
public void addNodeLabel(org.neo4j.gds.NodeLabel nodeLabel)
Description copied from interface:IdMap
Adds new node label to the available node labels. The labels is not assigned to any nodes at this point.- Specified by:
addNodeLabel
in interfaceIdMap
- Parameters:
nodeLabel
- the node label to add
-
addNodeIdToLabel
public void addNodeIdToLabel(long nodeId, org.neo4j.gds.NodeLabel nodeLabel)
Description copied from interface:IdMap
Assigns a node to the given node label.- Specified by:
addNodeIdToLabel
in interfaceIdMap
- Parameters:
nodeId
- the node id to assignnodeLabel
- the node label to which the node will be assigned to
-
-