-
-
Save SG-K/090261872d8b198fddb424b1e08591b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RateFilter extends Filter<Double> implements Filterable { | |
@Override | |
public ArrayList<Item> applyFilter(ArrayList<Item> arrayList) { | |
if (value == null) { | |
return arrayList; | |
} else { | |
ArrayList<Item> newArrayList = new ArrayList<>(); | |
for(int i = 0 ; i < arrayList.size(); i++){ | |
double tmp = arrayList.get(i).getRate(); | |
if( value <= tmp) | |
newArrayList.add(arrayList.get(i)); | |
} | |
return newArrayList; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment