Bladeren bron

Generify ListUtil methods

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1066626 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_1rc1old
Andreas L. Delmelle 13 jaren geleden
bovenliggende
commit
99958ef625
1 gewijzigde bestanden met toevoegingen van 6 en 6 verwijderingen
  1. 6
    6
      src/java/org/apache/fop/util/ListUtil.java

+ 6
- 6
src/java/org/apache/fop/util/ListUtil.java Bestand weergeven

@@ -34,22 +34,22 @@ public final class ListUtil {
/**
* Retrieve the last element from a list.
*
* @param list
* The list to work on
* @param <T> the type of objects stored in the list
* @param list the list to work on
* @return last element
*/
public static Object getLast(List list) {
public static <T> T getLast(List<T> list) {
return list.get(list.size() - 1);
}

/**
* Retrieve and remove the last element from a list.
*
* @param list
* The list to work on
* @param <T> the type of objects stored in the list
* @param list the list to work on
* @return previous last element
*/
public static Object removeLast(List list) {
public static <T> T removeLast(List<T> list) {
return list.remove(list.size() - 1);
}
}

Laden…
Annuleren
Opslaan