class BINSTR < $STRING{OCTET,FBINSTR,BINSTR}, $IS_EQ, $IS_LT{BINSTR},$IMMUTABLE, $HASH
****

________This_class_is_an_immutable_version_of_FBINSTR_where_every_operation
___yielding_a_BINSTR_creates_a_new_buffer_to_contain_it.


Ancestors
$HASH $IS_EQ $IMMUTABLE $STR
$BINARY $IS_LT{_} $STRING{_,_,_} $SEARCH{_,_}
$STRINGS $NIL $IS_NIL $STRING{_}
$LISTS{_} $ARR{_} $RO_ARR{_} $CONTAINER{_}
$COPY $FILTERS{_} $ELT{_} $ELT



Public


Features
aclear .. Included as aclear
acopy(src : SAME) .. Included as acopy
acopy(beg : CARD, src : SAME) .. Included as acopy
acopy(beg, num : CARD, src : SAME) .. Included as acopy
acopy(beg, num, srcbeg : CARD, src : SAME) .. Included as acopy
acopy(src : $STRINGS) .. Included as acopy
acopyn(str : SAME,cnt : CARD) .. Included as acopyn
**** This routine copies cnt items from str into self or as many as will
___fit_if_self_is_not_large_enough.
acopyn(fstr : FSTP,cnt : CARD) .. Included as acopyn
aget(index : CARD) : ELT .. Included as aget
aget(index : INT) : ELT .. Included as aget
append(src : SAME) : SAME .. Included as append
create(cnt : CARD) : SAME .. Included as aref_create
**** This routine returns a new array with cnt elements.
array_ptr : REFERENCE .. Included as array_ptr
aset(index : CARD, val : ELT) .. Included as aset
aset(index : INT, val:ELT) .. Included as aset
asize : CARD .. Included as asize
binstr : BINSTR
****
________This_routine_returns_a_copy_of_self.__It_is_provided_to_meet_the
___interface_requirements_of_$BINARY.
build(cursor : BIN_CURSOR) : SAME
concat_all(arry : ARRAY{SAME}) : SAME .. Included as concat_all
contains(elem : ELT) : BOOL .. Included as contains
**** This predicate returns true if and only if at least one of
___the_elements_of_self_has_the_value_elem,_otherwise_false.
copy : SAME .. Included as copy
count(str : SAME) : CARD .. Included as count
count(elem : ELT) : CARD .. Included as count
count_if( .. Included as count_if
create(arr : ARRAY{OCTET}) : SAME
create(str : BINSTR) : SAME .. Included as create
create(size : CARD) : SAME
**** This produces a binary string of the given size - empty!
create(oct : OCTET) : SAME
create : SAME
**** This routine yields void as an empty string.
cursor : BIN_CURSOR
****
elt_eq(first,second : ETP) : BOOL .. Included as elt_eq
**** This is the standard 'less than' predicate used in sorting routines.
___The_using_class_must_specify_an_equality_predicate_routine.
elt_hash(elem : $OB) : CARD .. Included as elt_hash
****
________This_routine_returns_a_hash_value_associated_with_an_element._This
___must_have_the_property_that_if_"elt_eq(first,second)"_then
___"elt_hash(first)=elt_hash(second)"._It_could_be_defined_always_to_return_0,
___but_many_routines_will_then_become_quadratic._This_uses_the_object_"id"_by
___default.___It_may_be_redefined_in_descendants.
elt_lt(first,second : ETP) : BOOL .. Included as elt_lt
****
________This_routine_is_the_standard_predicate_'less_than'_for_use_in
___sorting.___By_default_the_object_identity_components_are_compared.
___It_may_be_redefined_in_descendants.
elt_nil : ETP .. Included as elt_nil
****
________This_routine_returns_the_NIL_value.___If_the_element_class_is_a
___subclass_of_$NIL_then_it_returns_nil,_otherwise_void.
every( .. Included as every
exists( .. Included as exists
exists( .. Included as exists
fbinstr : FBINSTR
from_fstr(fstr : FSTP) : SAME .. Included as from_fstr
has_ind(val : CARD) : BOOL .. Included as has_ind
**** This predicate returns true if and only if self may be indexed by the given value.
hash : CARD .. Included as hash
****
__This_routine_returns_a_hash_value_formed_from_all_of_the_elements_of_the_string.
head(cnt : CARD) : SAME .. Included as head
is_elt_nil( elem : ETP) : BOOL .. Included as is_elt_nil
**** This predicate returns true if and only if elem is NIL.
is_empty : BOOL .. Included as is_empty
**** This predicate returns true if and only if self is an empty string.
is_eq(other : SAME) : BOOL
**** This predicate returns true if and only if self and other are the
___same._Either_may_be_void.
is_eq(other : $OB) : BOOL .. Included as is_eq
**** This is the generic equality predicate. c.f. the class $IS_EQ
is_lt(other : SAME) : BOOL
**** This predicate returns true if and only if the bit pattern contained
___in_the_string_is_octet_for_octet_less_than_the_bit_pattern_contained
___in_other.
is_nil : BOOL .. Included as is_nil
****
__This_predicate_returns_true_if_and_only_if_the_string_is_empty.
is_prefix(other : SAME) : BOOL .. Included as is_prefix
**** This predicate returns true if and only if other is identical to the
___bit-pattern_starting_at_the_beginning_of_self.
mismatch(other : SAME) : CARD .. Included as mismatch
nil : SAME .. Included as nil
**** This predicate returns true if and only if the string is empty.
not_every( .. Included as not_every
not_exists( .. Included as not_exists
pad(length : CARD) : SAME
plus(str : SAME) : SAME .. Included as plus
plus(fstr : FSTP) : SAME .. Included as plus
plus(hex : HEXTET) : SAME
plus(elem : ELT) : SAME .. Included as plus
read(index : BIN_CURSOR) : SAME .. Included as read
reverse : SAME .. Included as reverse
search(str : SAME) : CARD .. Included as search
search(str : SAME,start : CARD) : CARD .. Included as search
search(elem : ELT) : CARD .. Included as search
search(elem : ELT, start : CARD) : CARD .. Included as search
search_backwards(elem : ELT) : CARD .. Included as search_backwards
search_backwards(elem : ELT,start : CARD) : CARD .. Included as search_backwards
size : CARD
**** This routine returns the number of elements in the string.
sized : SAME
str(lib : LIBCHARS) : STR
str : STR
substring(beg, num : CARD) : SAME .. Included as substring
tail(cnt : CARD) : SAME .. Included as tail
text_str(lib : LIBCHARS) : STR
text_str : STR
write(fyle : BIN_FILE) .. Included as write

Iters
aelt!(once beg : CARD) : ELT .. Included as aelt!
aelt!(once beg, once num : CARD) : ELT .. Included as aelt!
aelt!(once beg,once num : CARD,once step : INT) : ELT .. Included as aelt!
aelt! : ELT .. Included as aelt!
aind! : CARD .. Included as aind!
aset!(val : ELT) .. Included as aset!
aset!(once beg : CARD,val : ELT) .. Included as aset!
aset!(once beg, once num : CARD, val : ELT) .. Included as aset!
aset!(once beg, once num : CARD, once step : INT,val : ELT) .. Included as aset!
chunk!(chunk_size : CARD) : SAME .. Included as chunk!
chunk!( once start : CARD, chunk_size : CARD) : SAME .. Included as chunk!
elt!(once start : CARD ) : ELT .. Included as elt!
elt!(once start, once num : CARD) : ELT .. Included as elt!
elt! : ELT .. Included as elt!
filter!( .. Included as filter!
ind! : CARD .. Included as ind!
not_filter!( .. Included as not_filter!
set!(elem : ELT) .. Included as set!
unique! : ETP .. Included as unique!


Private

const Default_Array_Size : CARD := 5 ; .. Included as Default_Array_Size
const Hash_Prime : FIELD := 19 ; .. Included as Hash_Prime
append_destroy(src : SAME,destroy : BOOL) : SAME .. Included as append_destroy
for_all(first, second : SAME) : BOOL .. Included as for_all
****
__This_private_predicate_returns_true_if_and_only_if_all_elements_of
___first_and_second_are_the_same!
forall(elem : ELT, from, to : CARD) : BOOL .. Included as forall
**** This private predicate is used in testing the post-condition of
___the_searching_routines_which_follow.__It_returns_true_if_and_only_if
___the_test_element_is_not_found_in_the_inclusive_range_given.__It_is
___expensive!
is_eq_helper(bstr : SAME,cnt : CARD) : BOOL
**** This predicate returns true if and only if the binary string is the
___same_as_self.
is_legal_aelts_arg(beg, num : CARD, step : INT) : BOOL .. Included as is_legal_aelts_arg
**** This predicate returns true if and only if the arguments are legal
___values_for_aelt_and_aset_iters_below.
null_tail(buff : SAME,tail : CARD)
**** This private predicate is used solely in post-condition testing.
___It_returns_true_if_and_only_if_all_tail_elements_of_buff_are_the_null
___octet,_otherwise_false.
null_tail(str : SAME,from : CARD) : BOOL
**** This private predicate returns true if and only if the tail (starting
___at_from)_is_all_null_octets.
pairwise(other : SAME, last : CARD) : BOOL .. Included as pairwise
****
__This_private_predicate_is_used_in_the_post-condition_of_routines
___below.__It_returns_true_if_and_only_if_the_elements_of_self_and_other_are
___identical_up_to_and_not_including_last.
store_index(elem_index : CARD) : CARD
****
________This_routine_returns_the_store_index_corresponding_to_the_given
___element_index_for_use_where_they_may_be_different).__In_this_class_the_two
___indices_are_identical.
sum_OK(arry : ARRAY{SAME}) : BOOL .. Included as sum_OK
****
__This_is_an_auxiliary_predicate_only_used_in_the_post-condition_test
___for_the_following_routine.___It_is_very_expensive!
to_reverse .. Included as to_reverse
****
__This_private_routine_is_the_one_which_actually_reverses_the_contents.

The Sather Home Page