/** * Returns a transformed list backed by the given list. * <p> * Each object is passed through the transformer as it is added to the * List. It is important not to use the original list after invoking this * method, as it is a backdoor for adding untransformed objects. * * @param list the list to predicate, must not be null * @param transformer the transformer for the list, must not be null * @return a transformed list backed by the given list * @throws IllegalArgumentException if the List or Transformer is null */ public static List transformedList(List list, Transformer transformer) { return TransformedList.decorate(list, transformer); }
public List subList(int fromIndex, int toIndex) { List sub = getList().subList(fromIndex, toIndex); return new TransformedList(sub, transformer); }
public ListIterator listIterator() { return listIterator(0); }
public int indexOf(Object object) { return getList().indexOf(object); }
/** * Factory method to create a transforming list. * <p> * If there are any elements already in the list being decorated, they * are NOT transformed. * * @param list the list to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @throws IllegalArgumentException if list or transformer is null */ public static List decorate(List list, Transformer transformer) { return new TransformedList(list, transformer); }
public int lastIndexOf(Object object) { return getList().lastIndexOf(object); }
/** * Factory method to create a transforming list. * <p> * If there are any elements already in the list being decorated, they * are NOT transformed. * * @param list the list to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @throws IllegalArgumentException if list or transformer is null */ public static List decorate(List list, Transformer transformer) { return new TransformedList(list, transformer); }
public Object remove(int index) { return getList().remove(index); }
public List subList(int fromIndex, int toIndex) { List sub = getList().subList(fromIndex, toIndex); return new TransformedList(sub, transformer); }
/** * Returns a transformed list backed by the given list. * <p> * Each object is passed through the transformer as it is added to the * List. It is important not to use the original list after invoking this * method, as it is a backdoor for adding untransformed objects. * * @param list the list to predicate, must not be null * @param transformer the transformer for the list, must not be null * @return a transformed list backed by the given list * @throws IllegalArgumentException if the List or Transformer is null */ public static List transformedList(List list, Transformer transformer) { return TransformedList.decorate(list, transformer); }
/** * Factory method to create a transforming list. * <p> * If there are any elements already in the list being decorated, they * are NOT transformed. * * @param list the list to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @throws IllegalArgumentException if list or transformer is null */ public static List decorate(List list, Transformer transformer) { return new TransformedList(list, transformer); }
public ListIterator listIterator() { return listIterator(0); }
public Object get(int index) { return getList().get(index); }
public List subList(int fromIndex, int toIndex) { List sub = getList().subList(fromIndex, toIndex); return new TransformedList(sub, transformer); }
public List makeEmptyList() { return TransformedList.decorate(new ArrayList(), TestTransformedCollection.NOOP_TRANSFORMER); }
/** * Factory method to create a transforming list. * <p> * If there are any elements already in the list being decorated, they * are NOT transformed. * * @param list the list to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @throws IllegalArgumentException if list or transformer is null */ public static List decorate(List list, Transformer transformer) { return new TransformedList(list, transformer); }