Module org.jgrapht.core
Package org.jgrapht.alg.interfaces
Class PartitioningAlgorithm.PartitioningImpl<V>
- java.lang.Object
-
- org.jgrapht.alg.interfaces.PartitioningAlgorithm.PartitioningImpl<V>
-
- Type Parameters:
V
- the vertex type
- All Implemented Interfaces:
Serializable
,Iterable<Set<V>>
,PartitioningAlgorithm.Partitioning<V>
- Enclosing interface:
- PartitioningAlgorithm<V>
public static class PartitioningAlgorithm.PartitioningImpl<V> extends Object implements PartitioningAlgorithm.Partitioning<V>, Serializable
Default implementation of a vertex partition- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PartitioningImpl(List<Set<V>> classes)
Construct a new vertex partitioning.PartitioningImpl(Map<V,Integer> vertexToPartitionMap)
Construct a new vertex partitioning.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNumberPartitions()
Get the number of partitions.Set<V>
getPartition(int index)
Get the index-th partition (0-based).Iterator<Set<V>>
iterator()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.jgrapht.alg.interfaces.PartitioningAlgorithm.Partitioning
getPartitions
-
-
-
-
Constructor Detail
-
PartitioningImpl
public PartitioningImpl(List<Set<V>> classes)
Construct a new vertex partitioning.- Parameters:
classes
- the partition classes- Throws:
NullPointerException
- ifclasses
isnull
-
PartitioningImpl
public PartitioningImpl(Map<V,Integer> vertexToPartitionMap)
Construct a new vertex partitioning.- Parameters:
vertexToPartitionMap
- the vertex to partition index map- Throws:
NullPointerException
- ifvertexToPartitionMap
isnull
-
-
Method Detail
-
getNumberPartitions
public int getNumberPartitions()
Get the number of partitions.- Specified by:
getNumberPartitions
in interfacePartitioningAlgorithm.Partitioning<V>
- Returns:
- the number of partitions
-
getPartition
public Set<V> getPartition(int index)
Get the index-th partition (0-based).- Specified by:
getPartition
in interfacePartitioningAlgorithm.Partitioning<V>
- Parameters:
index
- index of the partition to return- Returns:
- the index-th partition
-
-