code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Override
public LinearSet<V> union(ISet<V> s) {
if (s instanceof LinearSet) {
return new LinearSet<V>(map.union(((LinearSet<V>) s).map));
} else {
LinearMap<V, Void> m = map.clone();
s.forEach(e -> m.put(e, null));
return new LinearSet<V>(m);
}
} | @param hashFn the hash function used by the set
@param equalsFn the equality semantics used by the set | union | java | lacuna/bifurcan | src/io/lacuna/bifurcan/LinearSet.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/LinearSet.java | MIT |
@Override
public LinearSet<V> difference(ISet<V> s) {
if (s instanceof LinearSet) {
return new LinearSet<V>(map.difference(((LinearSet<V>) s).map));
} else {
LinearMap<V, Void> m = map.clone();
s.forEach(m::remove);
return new LinearSet<V>(m);
}
} | @param hashFn the hash function used by the set
@param equalsFn the equality semantics used by the set | difference | java | lacuna/bifurcan | src/io/lacuna/bifurcan/LinearSet.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/LinearSet.java | MIT |
@Override
public LinearSet<V> intersection(ISet<V> s) {
if (s instanceof LinearSet) {
return new LinearSet<V>(map.intersection(((LinearSet<V>) s).map));
} else {
LinearMap<V, Void> m = map.clone();
for (V e : this) {
if (!s.contains(e)) {
m.remove(e);
}
}
... | @param hashFn the hash function used by the set
@param equalsFn the equality semantics used by the set | intersection | java | lacuna/bifurcan | src/io/lacuna/bifurcan/LinearSet.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/LinearSet.java | MIT |
@Override
public ISet<V> forked() {
return Set.from(this);
} | @param hashFn the hash function used by the set
@param equalsFn the equality semantics used by the set | forked | java | lacuna/bifurcan | src/io/lacuna/bifurcan/LinearSet.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/LinearSet.java | MIT |
@Override
public LinearSet<V> linear() {
return this;
} | @param hashFn the hash function used by the set
@param equalsFn the equality semantics used by the set | linear | java | lacuna/bifurcan | src/io/lacuna/bifurcan/LinearSet.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/LinearSet.java | MIT |
@Override
public List<LinearSet<V>> split(int parts) {
return map.split(parts).stream().map(m -> new LinearSet<>(m)).collect(Lists.collector());
} | @param hashFn the hash function used by the set
@param equalsFn the equality semantics used by the set | split | java | lacuna/bifurcan | src/io/lacuna/bifurcan/LinearSet.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/LinearSet.java | MIT |
@Override
public int hashCode() {
if (hash == -1) {
hash = 0;
for (long row : map.table) {
if (LinearMap.Row.populated(row)) {
hash += LinearMap.Row.hash(row);
}
}
}
return hash;
} | @param hashFn the hash function used by the set
@param equalsFn the equality semantics used by the set | hashCode | java | lacuna/bifurcan | src/io/lacuna/bifurcan/LinearSet.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/LinearSet.java | MIT |
@Override
public LinearSet<V> clone() {
return new LinearSet<>(map.clone());
} | @param hashFn the hash function used by the set
@param equalsFn the equality semantics used by the set | clone | java | lacuna/bifurcan | src/io/lacuna/bifurcan/LinearSet.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/LinearSet.java | MIT |
public static <V> List<V> of(V... elements) {
List<V> list = new List<V>().linear();
for (V e : elements) {
list.addLast(e);
}
return list.forked();
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | of | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
public static <V> List<V> from(IList<V> list) {
if (list instanceof List) {
return ((List<V>) list).forked();
} else {
return from(list.iterator());
}
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | from | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
public static <V> List<V> from(Iterable<V> iterable) {
return from(iterable.iterator());
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | from | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
public static <V> List<V> from(Iterator<V> iterator) {
List<V> list = new List<V>().linear();
iterator.forEachRemaining(list::addLast);
return list.forked();
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | from | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
public static <V> List<V> empty() {
return (List<V>) EMPTY;
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | empty | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public V nth(long idx) {
long rootSize = root.size();
if (idx < 0 || idx >= (rootSize + prefixLen + suffixLen)) {
throw new IndexOutOfBoundsException(idx + " must be within [0," + size() + ")");
}
// look in the prefix
if (idx < prefixLen) {
return (V) prefix[(int) (prefix.l... | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | nth | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public long size() {
return root.size() + prefixLen + suffixLen;
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | size | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public boolean isLinear() {
return editor != null;
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | isLinear | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public List<V> addLast(V value) {
return (isLinear() ? this : clone()).pushLast(value);
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | addLast | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public List<V> addFirst(V value) {
return (isLinear() ? this : clone()).pushFirst(value);
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | addFirst | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public List<V> removeLast() {
return (isLinear() ? this : clone()).popLast();
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | removeLast | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public List<V> removeFirst() {
return (isLinear() ? this : clone()).popFirst();
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | removeFirst | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public List<V> set(long idx, V value) {
int size = (int) size();
if (idx < 0 || idx > size) {
throw new IndexOutOfBoundsException();
}
if (idx == size) {
return addLast(value);
} else {
return (isLinear() ? this : clone()).overwrite((int) idx, value);
}
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | set | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public Iterator<V> iterator() {
final Object[] initChunk;
final int initOffset, initLimit;
final long size = size();
final long rootSize = root.size();
if (prefixLen > 0) {
initChunk = prefix;
initOffset = pIdx(0);
initLimit = prefix.length;
} else if (rootSize > ... | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | iterator | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public boolean hasNext() {
return idx < size;
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | hasNext | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public V next() {
V val = (V) chunk[offset++];
if (offset == limit) {
idx += chunkSize;
if (idx < size) {
if (idx == prefixLen + rootSize) {
chunk = suffix;
limit = suffixLen;
} else {
chunk = (Object[... | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | next | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public List<V> slice(long start, long end) {
if (start < 0 || end > size()) {
throw new IndexOutOfBoundsException("[" + start + "," + end + ") isn't a subset of [0,"+ size() + ")");
} else if (end <= start) {
return new List<>();
}
int pStart = (int) min(prefixLen, start);
i... | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | slice | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public IList<V> concat(IList<V> l) {
if (l instanceof List) {
List<V> b = (List<V>) l;
Node r = root;
Object editor = new Object();
// append our own suffix
if (suffixLen > 0) {
r = r.pushLast(suffixArray(), editor);
}
// append their prefix
if (... | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | concat | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public List<V> forked() {
return isLinear() ? new List(false, root, prefixLen, prefix, suffixLen, suffix).clone() : this;
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | forked | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public List<V> linear() {
return isLinear() ? this : new List(true, root, prefixLen, prefix, suffixLen, suffix).clone();
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | linear | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public List<V> clone() {
return new List<V>(
isLinear(), root,
prefixLen, prefix == null ? null : prefix.clone(),
suffixLen, suffix == null ? null : suffix.clone()
);
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | clone | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
private Object[] suffixArray() {
Object[] suf = new Object[suffixLen];
arraycopy(suffix, 0, suf, 0, suf.length);
return suf;
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | suffixArray | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
private Object[] prefixArray() {
Object[] pre = new Object[prefixLen];
arraycopy(prefix, pIdx(0), pre, 0, pre.length);
return pre;
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | prefixArray | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
private int pIdx(int idx) {
return prefix.length - prefixLen + idx;
} | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | pIdx | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
List<V> overwrite(int idx, V value) {
long rootSize = root.size();
// overwrite prefix
if (idx < prefixLen) {
prefix[prefix.length - prefixLen + idx] = value;
// overwrite tree
} else if (idx < (prefixLen + rootSize)) {
root = root.set(editor, idx - prefixLen, value);
// overw... | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | overwrite | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
List<V> pushFirst(V value) {
if (prefix == null) {
prefix = new Object[2];
} else if (prefixLen == prefix.length) {
Object[] newPrefix = new Object[min(MAX_CHUNK_SIZE, prefix.length << 1)];
arraycopy(prefix, 0, newPrefix, newPrefix.length - prefixLen, prefixLen);
prefix = newPrefix;
... | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | pushFirst | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
List<V> pushLast(V value) {
if (suffix == null) {
suffix = new Object[2];
} else if (suffixLen == suffix.length) {
Object[] newSuffix = new Object[min(MAX_CHUNK_SIZE, suffix.length << 1)];
arraycopy(suffix, 0, newSuffix, 0, suffix.length);
suffix = newSuffix;
}
suffix[suffixLen... | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | pushLast | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
List<V> popFirst() {
if (prefixLen == 0) {
if (root.size() > 0) {
Object[] chunk = root.first();
if (chunk != null) {
Object editor = isLinear() ? this.editor : new Object();
prefix = chunk.clone();
prefixLen = (byte) prefix.length;
root = root.popFirst... | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | popFirst | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
List<V> popLast() {
if (suffixLen == 0) {
if (root.size() > 0) {
Object[] chunk = root.last();
if (chunk != null) {
Object editor = isLinear() ? this.editor : new Object();
suffix = chunk.clone();
suffixLen = (byte) suffix.length;
root = root.popLast(ed... | An implementation of an immutable list which allows for elements to be added and removed from both ends of the
collection, as well as random-access reads and writes. Due to its
<a href=https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf>relaxed radix structure</a>, {@code slice()},
{@code concat()}, and {@code... | popLast | java | lacuna/bifurcan | src/io/lacuna/bifurcan/List.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/List.java | MIT |
@Override
public int size() {
return (int) list.size();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | size | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean isEmpty() {
return list.size() == 0;
} | Utility functions for classes implementing {@link IList}.
@author ztellman | isEmpty | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean contains(Object o) {
return list.stream().anyMatch(e -> Objects.equals(o, e));
} | Utility functions for classes implementing {@link IList}.
@author ztellman | contains | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public Iterator<V> iterator() {
return list.iterator();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | iterator | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public Object[] toArray() {
return list.toArray();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | toArray | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
@SuppressWarnings("unchecked")
public <T> T[] toArray(T[] a) {
T[] ary = a.length < size() ? (T[]) Array.newInstance(a.getClass().getComponentType(), size()) : a;
IntStream.range(0, size()).forEach(i -> ary[i] = (T) get(i));
return ary;
} | Utility functions for classes implementing {@link IList}.
@author ztellman | toArray | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean add(V v) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | add | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean remove(Object o) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | remove | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean containsAll(Collection<?> c) {
return c.stream().allMatch(e -> contains(e));
} | Utility functions for classes implementing {@link IList}.
@author ztellman | containsAll | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean addAll(Collection<? extends V> c) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | addAll | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean addAll(int index, Collection<? extends V> c) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | addAll | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean removeAll(Collection<?> c) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | removeAll | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean retainAll(Collection<?> c) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | retainAll | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public void clear() {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | clear | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public V get(int index) {
return list.nth(index);
} | Utility functions for classes implementing {@link IList}.
@author ztellman | get | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public V set(int index, V element) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | set | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public void add(int index, V element) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | add | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public V remove(int index) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | remove | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public int indexOf(Object o) {
return IntStream.range(0, size())
.filter(idx -> Objects.equals(get(idx), o))
.findFirst()
.orElse(-1);
} | Utility functions for classes implementing {@link IList}.
@author ztellman | indexOf | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public int lastIndexOf(Object o) {
return size() -
IntStream.range(0, size())
.filter(idx -> Objects.equals(get(size() - (idx + 1)), o))
.findFirst()
.orElse(size() + 1);
} | Utility functions for classes implementing {@link IList}.
@author ztellman | lastIndexOf | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public ListIterator<V> listIterator() {
return listIterator(0);
} | Utility functions for classes implementing {@link IList}.
@author ztellman | listIterator | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public ListIterator<V> listIterator(int index) {
return new ListIterator<V>() {
int idx = index;
@Override
public boolean hasNext() {
return idx < size();
}
@Override
public V next() {
return get(idx++);
}
@Overr... | Utility functions for classes implementing {@link IList}.
@author ztellman | listIterator | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean hasNext() {
return idx < size();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | hasNext | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public V next() {
return get(idx++);
} | Utility functions for classes implementing {@link IList}.
@author ztellman | next | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean hasPrevious() {
return idx > 0;
} | Utility functions for classes implementing {@link IList}.
@author ztellman | hasPrevious | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public V previous() {
return get(--idx);
} | Utility functions for classes implementing {@link IList}.
@author ztellman | previous | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public int nextIndex() {
return idx;
} | Utility functions for classes implementing {@link IList}.
@author ztellman | nextIndex | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public int previousIndex() {
return idx - 1;
} | Utility functions for classes implementing {@link IList}.
@author ztellman | previousIndex | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public void remove() {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | remove | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public void set(V v) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | set | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public void add(V v) {
throw new UnsupportedOperationException();
} | Utility functions for classes implementing {@link IList}.
@author ztellman | add | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public java.util.List<V> subList(int fromIndex, int toIndex) {
return Lists.toList(list.slice(fromIndex, toIndex));
} | Utility functions for classes implementing {@link IList}.
@author ztellman | subList | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public int hashCode() {
return (int) Lists.hash(list, Objects::hashCode, (a, b) -> (a * 31) + b);
} | Utility functions for classes implementing {@link IList}.
@author ztellman | hashCode | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public boolean equals(Object obj) {
if (obj instanceof java.util.List) {
return Lists.equals(list, Lists.from((java.util.List) obj));
}
return false;
} | Utility functions for classes implementing {@link IList}.
@author ztellman | equals | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public String toString() {
return Lists.toString(list);
} | Utility functions for classes implementing {@link IList}.
@author ztellman | toString | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V, U> IList<U> lazyMap(IList<V> l, Function<V, U> f) {
return Lists.from(
l.size(),
i -> f.apply(l.nth(i)),
idx -> Iterators.map(l.iterator(idx), f)
);
} | Returns a list which will lazily, and repeatedly, transform each element of the input list on lookup.
@param l a list
@param f a transform function for the elements of the list
@param <V> the element type for the input list
@param <U> the element type for the result list
@return the result list | lazyMap | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> boolean equals(IList<V> a, IList<V> b) {
return equals(a, b, Objects::equals);
} | @return true if the two lists are equal, otherwise false | equals | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> boolean equals(IList<V> a, IList<V> b, BiPredicate<V, V> equals) {
if (a == b) {
return true;
} else if (a.size() != b.size()) {
return false;
}
return Iterators.equals(a.iterator(), b.iterator(), equals);
} | @param equals a comparison predicate for the lists of the element
@return true if the two lists are equal, otherwise false | equals | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> long hash(IList<V> l) {
return hash(l, Objects::hashCode, (a, b) -> (a * 31) + b);
} | @return a hash for the list, which mimics the standard Java hash calculation | hash | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> long hash(IList<V> l, ToLongFunction<V> hash, LongBinaryOperator combiner) {
return l.stream().mapToLong(hash).reduce(combiner).orElse(0);
} | @param hash a function which provides a hash for each element
@param combiner a function which combines the accumulated hash and element hash
@return a hash for the list | hash | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> String toString(IList<V> l) {
return toString(l, Objects::toString);
} | @return a string representation of the list, using toString() to represent each element | toString | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> String toString(IList<V> l, Function<V, String> printer) {
StringBuilder sb = new StringBuilder("[");
Iterator<V> it = l.iterator();
while (it.hasNext()) {
sb.append(printer.apply(it.next()));
if (it.hasNext()) {
sb.append(", ");
}
}
sb.append("]");
... | @param printer a function which returns a string representation of an element
@return a string representation fo the list | toString | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> java.util.List<V> toList(IList<V> list) {
return new JavaList(list);
} | @return a shim around the input list, presenting it as a standard Java List object | toList | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> IList<V> slice(IList<V> list, long start, long end) {
IList<V> result;
if (end <= start) {
result = List.EMPTY;
} else if (start < 0 || end > list.size()) {
throw new IndexOutOfBoundsException("[" + start + "," + end + ") isn't a subset of [0,"+ list.size() + ")");
} else ... | @param start the inclusive start index of the slice
@param end the exclusive end index of the slice
@return a subset view of the list, which holds onto a reference to the original | slice | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> IList<V> from(V[] array) {
return Lists.from(array.length, idx -> array[(int) idx]);
} | @return a view of the array as an IList | from | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> IList<V> from(java.util.List<V> list) {
LongFunction<V> nth = idx -> list.get((int) idx);
return Lists.from(
list.size(),
nth,
idx -> idx == 0 ? list.iterator() : Iterators.range(idx, list.size(), nth)
);
} | @return a view of the Java list as an IList | from | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> IList<V> from(long size, LongFunction<V> elementFn) {
return from(size, elementFn, idx -> Iterators.range(idx, size, elementFn));
} | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@return a list | from | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> IList<V> from(long size, LongFunction<V> elementFn, LongFunction<Iterator<V>> iteratorFn) {
return new IList.Mixin<V>() {
@Override
public V nth(long idx) {
if (idx < 0 || size <= idx) {
throw new IndexOutOfBoundsException(idx + " must be within [0," + size + ")");
... | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@param iteratorFn a function which generates an iterator for the list
@return a list | from | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public V nth(long idx) {
if (idx < 0 || size <= idx) {
throw new IndexOutOfBoundsException(idx + " must be within [0," + size + ")");
}
return elementFn.apply(idx);
} | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@param iteratorFn a function which generates an iterator for the list
@return a list | nth | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public IList<V> set(long idx, V value) {
return List.from(this).set(idx, value);
} | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@param iteratorFn a function which generates an iterator for the list
@return a list | set | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public IList<V> removeFirst() {
return Lists.slice(this, 1, size());
} | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@param iteratorFn a function which generates an iterator for the list
@return a list | removeFirst | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public IList<V> removeLast() {
return Lists.slice(this, 0, size() - 1);
} | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@param iteratorFn a function which generates an iterator for the list
@return a list | removeLast | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public IList<V> addFirst(V value) {
return Lists.concat(List.of(value), this);
} | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@param iteratorFn a function which generates an iterator for the list
@return a list | addFirst | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public IList<V> addLast(V value) {
return Lists.concat(this, List.of(value));
} | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@param iteratorFn a function which generates an iterator for the list
@return a list | addLast | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public IList<V> linear() {
return List.from(this).linear();
} | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@param iteratorFn a function which generates an iterator for the list
@return a list | linear | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public Iterator<V> iterator(long startIndex) {
return iteratorFn.apply(startIndex);
} | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@param iteratorFn a function which generates an iterator for the list
@return a list | iterator | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public long size() {
return size;
} | Creates a list which repeatedly uses the element function for each lookup.
@param size the size of the list
@param elementFn a function which returns the list for the given element
@param iteratorFn a function which generates an iterator for the list
@return a list | size | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> Collector<V, LinearList<V>, LinearList<V>> linearCollector() {
return linearCollector(8);
} | @return a Java stream collector which can be used to construct a LinearList | linearCollector | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
public static <V> Collector<V, LinearList<V>, LinearList<V>> linearCollector(int capacity) {
return new Collector<V, LinearList<V>, LinearList<V>>() {
@Override
public Supplier<LinearList<V>> supplier() {
return () -> new LinearList(capacity);
}
@Override
public BiConsumer<Lin... | @param capacity the initial capacity of the list which collects values.
@return a Java stream collector which can be used to construct a LinearList | linearCollector | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public Supplier<LinearList<V>> supplier() {
return () -> new LinearList(capacity);
} | @param capacity the initial capacity of the list which collects values.
@return a Java stream collector which can be used to construct a LinearList | supplier | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public BiConsumer<LinearList<V>, V> accumulator() {
return LinearList::addLast;
} | @param capacity the initial capacity of the list which collects values.
@return a Java stream collector which can be used to construct a LinearList | accumulator | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public BinaryOperator<LinearList<V>> combiner() {
return LinearList::linearConcat;
} | @param capacity the initial capacity of the list which collects values.
@return a Java stream collector which can be used to construct a LinearList | combiner | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
@Override
public Function<LinearList<V>, LinearList<V>> finisher() {
return x -> x;
} | @param capacity the initial capacity of the list which collects values.
@return a Java stream collector which can be used to construct a LinearList | finisher | java | lacuna/bifurcan | src/io/lacuna/bifurcan/Lists.java | https://github.com/lacuna/bifurcan/blob/master/src/io/lacuna/bifurcan/Lists.java | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.