Class ListGrouping<C extends Comparable<C>>
java.lang.Object
org.uma.jmetal.util.grouping.impl.ListGrouping<C>
- Type Parameters:
C-
- All Implemented Interfaces:
CollectionGrouping<List<C>>
- Direct Known Subclasses:
ListLinearGrouping,ListOrderedGrouping
public abstract class ListGrouping<C extends Comparable<C>>
extends Object
implements CollectionGrouping<List<C>>
Abstract class that groups a list of
Comparable entities by some order in the collection. The number of
groups is a constructor parameter and the group size is computed by dividing the list size
by the number of groups. If the remainder of this division is not zero, the last group will
contain the remaining index values (so, its size would be higher than the size of the rest of
groups).- Author:
- Antonio J. Nebro
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.uma.jmetal.util.grouping.CollectionGrouping
computeGroups
-
Field Details
-
numberOfGroups
protected final int numberOfGroups -
indices
-
groups
-
-
Constructor Details
-
ListGrouping
protected ListGrouping(int numberOfGroups)
-
-
Method Details
-
createGroups
protected void createGroups() -
numberOfGroups
public int numberOfGroups()- Specified by:
numberOfGroupsin interfaceCollectionGrouping<C extends Comparable<C>>
-
group
- Specified by:
groupin interfaceCollectionGrouping<C extends Comparable<C>>
-