expanded class STRING_RECYCLING_ITEM
Summary
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
Overview
Features
{ANY}
  • is_equal (other: STRING_RECYCLING_ITEM): BOOLEAN
    Is other attached to an object considered equal to current object?
  • copy (other: STRING_RECYCLING_ITEM)
    Update current object using fields of object attached to other, so as to yield equal objects.
{STRING_RECYCLING_POOL, STRING_RECYCLING_ITEM, STRING_RECYCLING_ITEM_SORTER}
{}
is_equal (other: STRING_RECYCLING_ITEM): BOOLEAN
effective function
{ANY}
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)
copy (other: STRING_RECYCLING_ITEM)
effective procedure
{ANY}
Update current object using fields of object attached to other, so as to yield equal objects.
Note: you can't copy object from a different dynamic type.
require
  • not immutable
  • same_dynamic_type(other)
ensure
  • is_equal(other)
The STRING item.
May become Void if the GC decides so.
Stores the STRING as being reusable.
The GC may remove it afterwards.
require
  • a_item = Void or else a_item.is_empty
ensure
set_capacity (a_capacity: INTEGER_32)
effective procedure
Sets the capacity.
Useful for array sorting and element comparison. Should not be used when a STRING is stored.
require
  • a_capacity >= 0
  • item = Void
ensure
item_memory: WEAK_REFERENCE[STRING]
writable attribute
{}
Holds a recyclable STRING