the number source object
Create a new number pool with the given label and the given numbers.
Creating number pools is a task that should only be performed at whatever counts as the initialization stage.
Create a new number pool with the given label and the given numbers.
Creating number pools is a task that should only be performed at whatever counts as the initialization stage.
Nothing technically blocks it being done during runtime;
however, stability is best served by doing it only once and while nothing else risk affecting the numbers.
Unlike "live" functionality which often returns as Success
or Failure
, this is considered a critical operation.
As thus, Exceptions
are permitted since a fault of the pool's creation will disrupt normal operations.
the name of the pool
the List
of numbers that will belong to the pool
the newly-created number pool
IllegalArgumentException
if the pool's name is already defined;
if the pool is (already) empty;
if the pool contains numbers the source does not;
if the pool contains numbers from already existing pools
Get the number pool known by this name.
Get the number pool known by this name. It will not return correctly for any number that is in the "restricted" pool.
the name of the pool
a reference to the number pool, or None
na
na
na
Remove an existing number pool with the given label from the list of number pools.
Removing number pools is a task that should only be performed at whatever counts as the termination stage.
Remove an existing number pool with the given label from the list of number pools.
Removing number pools is a task that should only be performed at whatever counts as the termination stage.
All the same reasoning applies as with AddPool
above.
Although an easy operation would move all the assigned numbers in the removing pool to the "generic" pool,
doing so is ill-advised both for the reasoning above and because that creates unreliability.
the name of the pool
the List
of numbers that belonged to the pool
IllegalArgumentException
if the pool doesn't exist or is not removed (removable)
Reference a specific number's pool.
WhichPool(IdentifiableEntity)
does require the object to be registered to be found.
Reference a specific number's pool.
WhichPool(IdentifiableEntity)
does require the object to be registered to be found.
It checks that the object is registered, and that it is registered to the local source object.
an object
the name of the number pool to which this item belongs
Reference a specific number's pool.
WhichPool(Int)
does not require the number to be registered at the time it is used.
Reference a specific number's pool.
WhichPool(Int)
does not require the number to be registered at the time it is used.
It does not return anything for an unregistered unpooled number -
a number that would be part of the "generic" nonstandard pool.
It only reports "generic" if that number is registered.
It will not return correctly for any number that is in the "restricted" pool.
a number
the name of the number pool to which this item belongs
Given a globally unique identifier, rweturn any object registered to it.
Use:
For val obj = new NumberPoolHub(...)
use obj(number)
.
Given a globally unique identifier, rweturn any object registered to it.
Use:
For val obj = new NumberPoolHub(...)
use obj(number)
.
the unique number to attempt to retrieve from the source
the object that is assigned to the number
Given a globally unique identifier, rweturn any object registered to it.
Use:
For val obj = new NumberPoolHub(...)
use obj(number)
.
Given a globally unique identifier, rweturn any object registered to it.
Use:
For val obj = new NumberPoolHub(...)
use obj(number)
.
the unique number to attempt to retrieve from the source
the object that is assigned to the number
Determines if the number is registered.
Two conditions are necessary to determine this condition for numbers.
Determines if the number is registered.
Two conditions are necessary to determine this condition for numbers.
(1) A registered number is known to the source
.
(2) A register number is known as Leased
to the source
.
the number previously assigned(?)
true
, if the number is registered; false
, otherwise
isRegistered(IdentifiableEntity)
Determines if the object is registered.
Three conditions are necessary to determine this condition for objects.
Determines if the object is registered.
Three conditions are necessary to determine this condition for objects.
(1) A registered object has a globally unique identifier.
(2) A registered object is known to the source
by that identifier.
(3) The registered object can be found attached to that entry from the source.
an object
true
, if the number is registered; false
, otherwise
isRegistered(Int)
na
na
an object being registered
the number whose assignment is requested
an object that has been registered
For accessing the Return
function of the contained NumberSource
directly.
For accessing the Return
function of the contained NumberSource
directly.
the number to return.
any object previously using this number
Register a number selected automatically from the named pool.
Register a number selected automatically from the named pool.
the local pool name
the monitor for a number
Register a specific number.
Register a specific number.
the number whose assignment is requested
the monitor for a number
Register an object to a specific number pool.
Register an object to a specific number pool.
an object being registered
the local pool name
the number the was given to the object
Register an object to a specific number if it is available.
Register an object to a specific number if it is available.
an object being registered
the number whose assignment is requested
the number the was given to the object
Register an object to any available selection (of the "generic" number pool).
Register an object to any available selection (of the "generic" number pool).
an object being registered
the number the was given to the object
Unregister a specific number.
Unregister a specific number.
the number previously assigned(?)
the object, if any, previous associated with the number
Unregister a specific object.
Unregister a specific object.
an object being unregistered
the number previously associated with the object
A master object that manages
NumberPool
s when they are applied to a singleNumberSource
. It catalogs the numbers and ensures the pool contents are unique to each other.All globally unique numbers are sorted into user-defined groups called pools. Pools are intended to pre-allocate certain numbers to certain tasks. Two default pools also exist - "generic," for all numbers not formally placed into a pool, and a hidden restricted pool. The former can accept a variety of numbers on the source not known at initialization time loaded into it. The latter can only be set by the
NumberSource
and can not be affected once this object is created.