EList

From Erights

Revision as of 03:33, 16 March 2009 by Kevin Reid (Talk | contribs)
Jump to: navigation, search

EList is the abstract supertype (XXX establish terminology: supertype or superclass?) of ConstList, FlexList, and ReadOnlyList. (XXX complete list?)

All indexing is zero-based. All ranges are specified as beginning index, inclusive, to ending index, exclusive (not inclusive end or location and size).

? def abcd := __identityFunc(["a", "b", "c", "d"]); null

Contents

Protocol

XXX Used a program to generate this list of msgdoc headers from E-on-Java. Clean up and write specs.

add/1

Signature: add(_ :null) :[[nullOk[ConstList]]]

asKeys/0

Signature: asKeys() :[[nullOk[ConstMap]]]

asMap/0

Signature: asMap() :[[nullOk[ConstMap]]]

asSet/0

Signature: asSet() :[[nullOk[ConstSet]]]

contains/1

Signature: contains(_ :null) :Boolean

diverge/0

Signature: diverge() :[[nullOk[FlexList]]]

diverge/1

Signature: diverge(_ :nullOk[Class]) :[[nullOk[FlexList]]]

fetch/2

Signature: fetch(_ :int32, _ :nullOk[Thunk]) :any

get/1

Signature: get(index :Integer) :valueType

Return the element at index.

? abcd[0]
# value: "a"

? abcd[2]
# value: "c"

? abcd[-1]
# problem: <XXX specify form of error>

? abcd[4]
# problem: <XXX specify form of error>  

getArray/0

Signature: getArray() :any

getArray/1

Signature: getArray(_ :nullOk[Class]) :any

getArray/3

Signature: getArray(_ :nullOk[Class], _ :int32, _ :int32) :any

includes/1

Signature: includes(_ :nullOk[EList]) :Boolean

indexOf1/1

Signature: indexOf1(_ :null) :int32

indexOf1/2

Signature: indexOf1(_ :null, _ :int32) :int32

iterate/1

Signature: iterate(_ :nullOk[AssocFunc]) :void

last/0

Signature: last() :any

lastIndexOf1/1

Signature: lastIndexOf1(_ :null) :int32

lastIndexOf1/2

Signature: lastIndexOf1(_ :null, _ :int32) :int32

lastStartOf/1

Signature: lastStartOf(_ :nullOk[EList]) :int32

lastStartOf/2

Signature: lastStartOf(_ :nullOk[EList], _ :int32) :int32

multiply/1

Signature: multiply(_ :int32) :[[nullOk[ConstList]]]

printOn/4

Signature: printOn(_ :nullOk[String], _ :nullOk[String], _ :nullOk[String], _ :nullOk[TextWriter]) :void

readOnly/0

Signature: readOnly() :[[nullOk[EList]]]

run/2

Signature: run(start :Integer, end :Integer) :{{{4}}} :ConstList

Return a ConstList containing the subsequence of elements in this list starting with element index start and ending with the element before index end.

? abcd.run(1, 3)
# value: ["b", "c"]

? abcd.run(0, abcd.size())
# value: ["a", "b", "c", "d"]

? ESpec.requireWrongArgsFail(abcd, "run", [0..!(abcd.size()), 0..!(abcd.size())])

{{XXX the above 'ESpec' is an idea about defining some utilities

run/1

Signature: run(start :Integer) :ConstList

Equivalent to thisEList.run(start, thisEList.size()).

? abcd.run(1)
# value: ["b", "c", "d"]

? abcd.run(0)
# value: ["a", "b", "c", "d"] 


size/0

Signature: size() :int32

snapshot/0

Signature: snapshot() :[[nullOk[ConstList]]]

sort/0

Signature: sort() :[[nullOk[ConstList]]]

sort/1

Signature: sort(_ :nullOk[CompFunc]) :[[nullOk[ConstList]]]

startOf/1

Signature: startOf(_ :nullOk[EList]) :int32

startOf/2

Signature: startOf(_ :nullOk[EList], _ :int32) :int32

valueType/0

Signature: valueType() :[[nullOk[Class]]]

with/1

Signature: with(_ :null) :[[nullOk[ConstList]]]

with/2

Signature: with(_ :int32, _ :null) :[[nullOk[ConstList]]]
This page is a stub; it should be expanded with more information. If doing so, check the original E web site and the mailing list archives for content which could be moved into this page.
Personal tools
more tools