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()
           
 
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()
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