nct.filter
Class SortFilter<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>

java.lang.Object
  extended by nct.filter.SortFilter<NodeType,WeightType>
All Implemented Interfaces:
Filter<NodeType,WeightType>

public class SortFilter<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
extends java.lang.Object
implements Filter<NodeType,WeightType>

This filter sorts the given solutions from best score (most positive) to worst.


Constructor Summary
SortFilter(boolean reverse)
          SortFilter constructor.
 
Method Summary
 java.util.List<Graph<NodeType,WeightType>> filter(java.util.List<Graph<NodeType,WeightType>> solutions)
          Given a List of Graphs, it sorts the graphs based on the comparable implementation of the graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortFilter

public SortFilter(boolean reverse)
SortFilter constructor. The first element will be the least.

Parameters:
reverse - Whether or not to reverse the sort so that the first element is the greatest and the last element is the least.
Method Detail

filter

public java.util.List<Graph<NodeType,WeightType>> filter(java.util.List<Graph<NodeType,WeightType>> solutions)
Given a List of Graphs, it sorts the graphs based on the comparable implementation of the graph.

Specified by:
filter in interface Filter<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
Parameters:
solutions - the List of Graphs to sort
Returns:
a new List containing the solutions passing the filter