C# Class clojure.lang.StreamSeq

Implements a persistent sequence over a stream.
Caches the stream values as retrieved.
Inheritance: clojure.lang.ASeq
Datei anzeigen Open project: arohner/clojure-contrib

Public Methods

Method Description
create ( IStream stream ) : StreamSeq

Create a sequence from a stream.

Requires looking at the first element of the stream. This is so that we know if the stream has any elements. This is so because the sequence must have at least element or be null.

first ( ) : object

Gets the first item.

rest ( ) : ISeq

Gets the rest of the sequence.

withMeta ( IPersistentMap meta ) : IObj

Create a copy with new metadata.

Private Methods

Method Description
StreamSeq ( IPersistentMap meta, Object first, ISeq rest ) : System

Construct a StreamSeq from metadata and first/rest.

StreamSeq ( object first, IStream stream ) : System

Construct a StreamSeq from a first item and a stream.

Method Details

create() public static method

Create a sequence from a stream.
Requires looking at the first element of the stream. This is so that we know if the stream has any elements. This is so because the sequence must have at least element or be null.
public static create ( IStream stream ) : StreamSeq
stream IStream The stream to sequence.
return StreamSeq

first() public method

Gets the first item.
public first ( ) : object
return object

rest() public method

Gets the rest of the sequence.
public rest ( ) : ISeq
return ISeq

withMeta() public method

Create a copy with new metadata.
public withMeta ( IPersistentMap meta ) : IObj
meta IPersistentMap The new metadata.
return IObj