class ELT_TBL < $STR
****
A table of class elements retrievable by name.
_
`get_query!(i:IDENT):ELT' yields each element named by `i'. `test(e:ELT):BOOL' tests for the given element. `insert(e:ELT):SAME' inserts an element. `delete(e:ELT):SAME' deletes an element. `elt!:ELT' yields each element.


Ancestors
$STR



Public


Readable Attributes
attr aref_asize:INT;
attr aref_get:INT;
attr aref_set:INT;

Writable Attributes
attr aref_asize:INT;
attr aref_get:INT;
attr aref_set:INT;

Features
clear:SAME
**** Clear out self, return the space if it has 17 or less entries otherwise return void. Self may be void.
copy:SAME
**** A copy of self.
create(n:INT):SAME
**** Make a table capable of dealing with `n' elements. You can simply insert into a void table to create one as well. Self may be void.
create:SAME
delete(e:T):SAME
**** A possibly new table which deletes the element which an element of self that is `elt_eq' to `e' if it exists. Doesn't modify the table if there is no such element. Usage: `tbl:=tbl.delete(e)'. Self may be void.
difference(s:SAME):SAME
**** A new set which is the difference between self and arg. Self may be void.
elt_conflicting_with(e:ELT):ELT
**** Returns an element of self that conflicts with `e' if one exists, otherwise returns void.
elt_hash(e:ELT):INT
**** A hash value computed from the name of an element.
elt_same_name_as(e:ELT):ELT
**** Returns an element of self that has the same name as `e' if one exists, otherwise returns void.
elt_with_sig(s:SIG):ELT
**** Return an element from this table with the signature `s' if present, void if not.
every(t:ROUT{T}:BOOL):BOOL
**** True if every element of self satisfies `t'. Self may be void.
filter(t:ROUT{T}:BOOL):SAME
**** A new set whose elements are those of self which satisfy `t'. Self may be void.
get(e:T):T
**** If `e' is `elt_eq' to a table entry, return that entry, otherwise return `elt_nil'. Useful when different objects are treated as equal (eg. a table of strings used to get a unique representative for each class of equal strings). Self may be void.
get_query(q:Q):T
**** Retrieve the first element associated with the query arg. Returns `elt_nil' if not present. Self may be void.
ifc:IFC
**** The interface of this set of elements.
insert(e:T):SAME
**** A possibly new table which includes `e'. If an entry is `elt_eq' to `e' then overwrite it with `e'. Usage: `tbl:=tbl.insert(e)'. Creates a new table if void(self).
intersect(s:SAME):SAME
**** A new set which is the intersection of self and `s'. Self may be void.
intersects(s:SAME):BOOL
**** True if self and `s' have elements in common. Self may be void.
is_disjoint_from(s:SAME):BOOL
**** True if self and `s' have no elements in common. Self may be void.
is_empty:BOOL
**** True if the set is empty. Self may be void.
is_eq(s:SAME):BOOL
**** True if `s' has the same elements as self. Self may be void.
is_subset(s:SAME):BOOL
**** True if all elements of self are contained in `s'. Self may be void.
map(m:ROUT{T}:T):SAME
**** A new set whose elements are `m' applied to those of self. Self may be void.
notany(t:ROUT{T}:BOOL):BOOL
**** True if none of the elements of self satisfies `t'. Self may be void.
notevery(t:ROUT{T}:BOOL):BOOL
**** True if not every element of self satisfies `t'. Self may be void.
public_ifc:IFC
**** The public interface of this set of elements.
query_hash(i:IDENT):INT
**** A hash value computed from the name `i'.
query_test(name:IDENT, e:ELT):BOOL
**** True if `e' is an element with the name `name'.
size:INT
**** Number of entries in the table. Self may be void.
some(t:ROUT{T}:BOOL):BOOL
**** True if some element of self satisfies `t'. Self may be void.
str:STR
sym_difference(s:SAME):SAME
**** A new set which is the symmetric difference between self and `s'. Self may be void.
test(e:T):BOOL
**** True if `e' is `elt_eq' to an element contained in self. Self may be void.
test_query(q:Q):BOOL
**** Test whether any elements are associated with the query `q'. Self may be void.
to_difference(s:SAME):SAME
**** The difference of self and `s', modifies self. Self may be void.
to_intersect(s:SAME):SAME
**** The intersection of self and `s', modifies self. Self may be void.
to_sym_difference(s:SAME):SAME
**** The symmetric difference of self and `s', modifies self. Self may be void.
to_union(s:SAME):SAME
**** The union of self and `s', modifies self. Self may be void.
union(s:SAME):SAME
**** A new set which is the union of self and `s'. Self may be void.

Iters
elt!:T
**** Yield the elements in self in an arbitrary order. Do not insert or delete from self while calling this. Self may be void.
get_query!(once q:Q):T
**** Retrieve all elements associated with the query `q'. Self may be void.


Private

aclear
**** Set each element of self to nil. Built-in.
acopy(src:SAME)
**** Copy as many elements from `src' to self as will fit. Built-in.
acopy(beg:INT, src:SAME)
**** Copy as many elements from `src' to self as will fit when starting at index `beg' of self.
acopy(beg,num:INT, src:SAME)
**** Copy `num' elements from `src' to self starting at index `beg' of self.
acopy(beg,num,srcbeg:INT, src:SAME)
**** Copy `num' elements from `src' to self starting at index `beg' of self and index `srcbeg' of `src'. Built-in.
aelt!(once beg:INT):T
**** Yield each element of self starting at `beg'. Built-in.
aelt!(once beg,once num:INT):T
**** Yield `num' successive elements of self starting at index `beg'. Built-in.
aelt!(once beg,once num,once step:INT):T
**** Yield `num' elements of self starting at `beg' and stepping by `step' which must not be zero. Built-in.
aelt!:T
**** Yield each element of self in order. Built-in.
aget(ind:INT):T
**** The element of self with index `ind'. Built-in.
aind!:INT
**** Yield the indices of self in order.
allocate(n:INT):SAME
**** Allocate `n' locations (must be power of 2 plus 1) and initialize to `elt_nil'.
aset!(val:T)
**** Set successive elements of self to the values `val'. Built-in.
aset!(once beg:INT,val:T)
**** Set successive elements of self starting at `beg' to the values `val'.
aset!(once beg,once num:INT,val:T)
**** Set `num' successive elements of self starting at `beg' to the values `val'.
aset!(once beg,once num,once step:INT, val:T)
**** Set `num' elements of self starting at `beg' stepping by `step' to the values `val'. `step' must not be zero.
aset(ind:INT, val:T)
**** Set the element of self with index `ind' to `val'. Built-in.
asize:INT
**** The number of elements in self. Classes which inherit this may replace this by a constant to get constant sized objects (and the compiler may optimize certain operations in this case). Built-in.
double_size:SAME
**** A new table of twice the size of self with self's entries copied over.
elt_eq(e1,e2:ETP):BOOL
**** The "less than" relation used in the sorting routines. Compares the object "id" by default. May be redefined in descendants.
elt_lt(e1,e2:ETP):BOOL
**** The "less than" relation used in the sorting routines. Compares the object "id" by default. May be redefined in descendants.
elt_nil: ETP
**** Return the nil value. If the element is under $NIL then return e.nil. Otherwise, return void
_
halve_size:SAME
**** A new table of half the size of self with self's entries copied over.
attr hsize:INT;
**** Number of stored entries.
attr hsize:INT;
**** Number of stored entries.
is_elt_nil(e:ETP):BOOL
is_legal_aelts_arg( beg, num, step:INT) :BOOL
**** True if the arguments are legal values for `aelts'.
const load_ratio:INT:=4;
**** Allow to be at most 1/load_ratio full
not_too_many(start, finish:INT):BOOL
**** A function called in an assert to check that really bad hashing isn't happening, which would probably be a performance bug. Since it is in an assert, this isn't called unless checking is on.
should_grow:BOOL
should_shrink:BOOL