Created
November 6, 2013 15:43
-
-
Save Nucleareal/7338272 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
package net.minecraft.src.nucleareal; | |
import java.util.List; | |
public class UtilList | |
{ | |
public static <T> int getLimitOrder(List<T> nextList, INumberCreator<T> order, int sign) | |
{ | |
int now = order.getValue(nextList.get(0)) * sign; | |
for(T element : nextList) | |
{ | |
int value = order.getValue(element) * sign; | |
if(value < now) | |
{ | |
now = value; | |
} | |
} | |
return now; | |
} | |
public static <T> int getMinValue(List<T> nextList, INumberCreator<T> order) | |
{ | |
return getLimitOrder(nextList, order, +1); | |
} | |
public static <T> int getMaxValue(List<T> nextList, INumberCreator<T> order) | |
{ | |
return getLimitOrder(nextList, order, -1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment