Skip to content

Instantly share code, notes, and snippets.

@MafaldaLandeiro
Created May 1, 2016 21:08
Show Gist options
  • Select an option

  • Save MafaldaLandeiro/2ae59af54360cef0e07d09933d7f754d to your computer and use it in GitHub Desktop.

Select an option

Save MafaldaLandeiro/2ae59af54360cef0e07d09933d7f754d to your computer and use it in GitHub Desktop.
Context
import java.util.List;
import strategyPattern.strategy.SortAlgorithm;
public class Context {
private SortAlgorithm sortAlgorithm;
/**
* @param sortAlgorithm
*/
public Context(SortAlgorithm sortAlgorithm) {
super();
this.sortAlgorithm = sortAlgorithm;
}
public void executeSort(List<Integer> unsorted){
sortAlgorithm.sort(unsorted);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment