home
wiki
classes/clusters list
class information
+
Point of view
All features
ANY
STRING_RECYCLING_ITEM
STRING_RECYCLING_POOL
INTERNALS_HANDLER
All features
expanded class STRING_RECYCLING_ITEM
Summary
top
Used by
STRING_RECYCLING_POOL
to track
STRING
capacities and to allow the use of a sorted array with
"holes"
(since
STRING
's are
WEAK_REFERENCE
'ed)
Direct parents
insert list:
ANY
Class invariant
top
item
/= Void implies
item
.capacity =
capacity
capacity
>= 0
Overview
top
features
is_equal
(other: STRING_RECYCLING_ITEM):
BOOLEAN
Is
other
attached to an object considered equal to current object?
capacity
:
INTEGER_32
item
:
STRING
The
STRING
item.
set_item
(a_item:
STRING
)
Stores the
STRING
as being reusable.
set_capacity
(a_capacity:
INTEGER_32
)
Sets the capacity.
item_memory
:
WEAK_REFERENCE
[
STRING
]
Holds a recyclable
STRING
is_equal
(other: STRING_RECYCLING_ITEM):
BOOLEAN
effective function
top
Is
other
attached to an object considered equal to current object?
require
other /= Void
ensure
commutative:
generating_type = other.generating_type implies Result = other.is_equal(Current)
capacity
:
INTEGER_32
writable attribute
top
item
:
STRING
effective function
top
The
STRING
item.
May become Void if the GC decides so.
set_item
(a_item:
STRING
)
effective procedure
top
Stores the
STRING
as being reusable.
The GC may remove it afterwards.
require
a_item = Void or else a_item.is_empty
ensure
item
= a_item
set_capacity
(a_capacity:
INTEGER_32
)
effective procedure
top
Sets the capacity.
Useful for array sorting and element comparison. Should not used when a
STRING
is stored.
require
a_capacity >= 0
item
= Void
ensure
capacity
= a_capacity
item_memory
:
WEAK_REFERENCE
[
STRING
]
writable attribute
top
Holds a recyclable
STRING