| 1 |
\name{Utility classes} |
| 2 |
\alias{named.list} |
| 3 |
\alias{item.list} |
| 4 |
\alias{named.list-class} |
| 5 |
\alias{item.list-class} |
| 6 |
\alias{initialize,item.list-method} |
| 7 |
\alias{initialize,named.list-method} |
| 8 |
\alias{coerce,data.set,named.list-method} |
| 9 |
\alias{show,named.list-method} |
| 10 |
\alias{atomic-class} |
| 11 |
\alias{double-class} |
| 12 |
\title{Named Lists, Lists of Items, and Atomic Vectors} |
| 13 |
\description{ |
| 14 |
The classes "named.list" and "item.list" are merely some |
| 15 |
'helper classes' for the construction of the classes "data.set" |
| 16 |
and "importer". |
| 17 |
|
| 18 |
Class "named.list" extends the basic class "list" by an additional |
| 19 |
slot "names". Its \code{initialize} method assures that the names |
| 20 |
of the list are unique. |
| 21 |
|
| 22 |
Class "item.list" extends the class "named.list", but does not |
| 23 |
add any slots. From "named.list" it differs only by the |
| 24 |
\code{initialize} method, which calls that for "named.list" |
| 25 |
and makes sure that all elements of the list belong to |
| 26 |
class "\link{item}". |
| 27 |
|
| 28 |
Classes "atomic" and "double" are merely used for |
| 29 |
method selection. |
| 30 |
} |
| 31 |
\examples{ |
| 32 |
new("named.list",a=1,b=2) |
| 33 |
|
| 34 |
# This should generate an error, since the names |
| 35 |
# are not unique. |
| 36 |
try(new("named.list",a=1,a=2)) |
| 37 |
|
| 38 |
# Another error, one name is missing. |
| 39 |
try(new("named.list",a=1,2)) |
| 40 |
|
| 41 |
# Also an error, the resulting list would be unnamed. |
| 42 |
try(new("named.list",1,2)) |
| 43 |
|
| 44 |
|
| 45 |
new("item.list",a=1,b=2) |
| 46 |
|
| 47 |
# Also an error: "item.list"s are "named.lists", |
| 48 |
# and here the names would be non-unique. |
| 49 |
try(new("item.list",a=1,a=2)) |
| 50 |
} |