
com.artclod.common.collect.base.BaseFList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functional-collections Show documentation
Show all versions of functional-collections Show documentation
FCollections is a series of function style Java Collections
package com.artclod.common.collect.base;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.stream.Stream;
import com.artclod.common.collect.FList;
import com.artclod.common.collect.GuavaImFList;
import com.artclod.common.collect.ReverseListIterator;
import com.google.common.collect.ImmutableList;
public abstract class BaseFList> extends BaseFColletion implements FList {
private static final long serialVersionUID = 1L;
protected final List inner;
public BaseFList(List inner) {
super(inner);
this.inner = inner;
}
protected Iterator reverseIterator() {
return new ReverseListIterator(this);
}
// ============ FLIST METHODS (or support) =========
public GuavaImFList toIm(){
return new GuavaImFList(ImmutableList.copyOf(this));
}
public boolean addAll(int index, Collection extends E> c) {
return inner.addAll(index, c);
}
public void sort(Comparator super E> c) {
inner.sort(c);
}
public void clear() {
inner.clear();
}
public E get(int index) {
return inner.get(index);
}
public E set(int index, E element) {
return inner.set(index, element);
}
public void add(int index, E element) {
inner.add(index, element);
}
public Stream stream() {
return inner.stream();
}
public E remove(int index) {
return inner.remove(index);
}
public int indexOf(Object o) {
return inner.indexOf(o);
}
public int lastIndexOf(Object o) {
return inner.lastIndexOf(o);
}
public ListIterator listIterator() {
return inner.listIterator();
}
public ListIterator listIterator(int index) {
return inner.listIterator(index);
}
public List subList(int fromIndex, int toIndex) {
return inner.subList(fromIndex, toIndex);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy