|
Copyright 2008 - 2010 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfj.data.List.Buffer<A>
public static final class List.Buffer<A>
A mutable, singly linked list. This structure should be used very sparingly, in favour
of the immutable singly linked list structure.
| Constructor Summary | |
|---|---|
List.Buffer()
|
|
| Method Summary | ||
|---|---|---|
List.Buffer<A> |
append(List<A> as)
Appends the given buffer to this buffer. |
|
static
|
empty()
An empty buffer. |
|
static
|
fromList(List<A> as)
Constructs a buffer from the given list. |
|
static
|
iterableBuffer(Iterable<A> i)
Takes the given iterable to a buffer. |
|
Iterator<A> |
iterator()
Returns an iterator for this buffer. |
|
List.Buffer<A> |
snoc(A a)
Appends (snoc) the given element to this buffer to produce a new buffer. |
|
Collection<A> |
toCollection()
Projects an immutable collection of this buffer. |
|
List<A> |
toList()
Returns an immutable list projection of this buffer. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public List.Buffer()
| Method Detail |
|---|
public Iterator<A> iterator()
for-each loop.
iterator in interface Iterable<A>public List.Buffer<A> snoc(A a)
a - The element to append to this buffer.
public List.Buffer<A> append(List<A> as)
as - The buffer to append to this one.
public List<A> toList()
public Collection<A> toCollection()
public static <A> List.Buffer<A> empty()
public static <A> List.Buffer<A> fromList(List<A> as)
as - The list to construct a buffer with.
public static <A> List.Buffer<A> iterableBuffer(Iterable<A> i)
i - The iterable to take to a buffer.
|
Copyright 2008 - 2010 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||