Packages

class NumberPoolHub extends AnyRef

A master object that manages NumberPools when they are applied to a single NumberSource. 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.

Source
NumberPoolHub.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NumberPoolHub
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new NumberPoolHub(source: NumberSource)

    source

    the number source object

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def AddPool(name: String, pool: List[Int]): NumberPool

    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.

    name

    the name of the pool

    pool

    the List of numbers that will belong to the pool

    returns

    the newly-created number pool

    Exceptions thrown

    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

  5. def GetPool(name: String): Option[NumberPool]

    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.

    name

    the name of the pool

    returns

    a reference to the number pool, or None

  6. def Numbers: List[Int]
  7. def Pools: HashMap[String, NumberPool]

    na

    na

    returns

    na

  8. def RemovePool(name: String): List[Int]

    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.

    name

    the name of the pool

    returns

    the List of numbers that belonged to the pool

    Exceptions thrown

    IllegalArgumentException if the pool doesn't exist or is not removed (removable)

  9. def WhichPool(obj: IdentifiableEntity): Option[String]

    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.

    obj

    an object

    returns

    the name of the number pool to which this item belongs

  10. def WhichPool(number: Int): Option[String]

    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.

    number

    a number

    returns

    the name of the number pool to which this item belongs

  11. def apply(number: Int): Option[IdentifiableEntity]

    Given a globally unique identifier, return any object registered to it.

    Use:
    For val obj = new NumberPoolHub(...) use obj(number).

    Given a globally unique identifier, return any object registered to it.

    Use:
    For val obj = new NumberPoolHub(...) use obj(number).

    number

    the unique number to attempt to retrieve from the source

    returns

    the object that is assigned to the number

  12. def apply(number: PlanetSideGUID): Option[IdentifiableEntity]

    Given a globally unique identifier, return any object registered to it.

    Use:
    For val obj = new NumberPoolHub(...) use obj(number).

    Given a globally unique identifier, return any object registered to it.

    Use:
    For val obj = new NumberPoolHub(...) use obj(number).

    number

    the unique number to attempt to retrieve from the source

    returns

    the object that is assigned to the number

  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def isRegistered(number: Int): Boolean

    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.

    number

    the number previously assigned(?)

    returns

    true, if the number is registered; false, otherwise

    See also

    isRegistered(IdentifiableEntity)

  22. def isRegistered(obj: IdentifiableEntity): Boolean

    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.

    obj

    an object

    returns

    true, if the number is registered; false, otherwise

    See also

    isRegistered(Int)

  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. def register(name: String): Try[LoanedKey]

    Register a number selected automatically from the named pool.

    Register a number selected automatically from the named pool.

    name

    the local pool name

    returns

    the monitor for a number

  27. def register(number: Int): Try[LoanedKey]

    Register a specific number.

    Register a specific number.

    number

    the number whose assignment is requested

    returns

    the monitor for a number

  28. def register(obj: IdentifiableEntity, name: String): Try[Int]

    Register an object to a specific number pool.

    Register an object to a specific number pool.

    obj

    an object being registered

    name

    the local pool name

    returns

    the number the was given to the object

  29. def register(obj: IdentifiableEntity, number: Int): Try[Int]

    Register an object to a specific number if it is available.

    Register an object to a specific number if it is available.

    obj

    an object being registered

    number

    the number whose assignment is requested

    returns

    the number the was given to the object

  30. def register(obj: IdentifiableEntity): Try[Int]

    Register an object to any available selection (of the "generic" number pool).

    Register an object to any available selection (of the "generic" number pool).

    obj

    an object being registered

    returns

    the number the was given to the object

  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. def unregister(number: Int): Try[Option[IdentifiableEntity]]

    Unregister a specific number.

    Unregister a specific number.

    number

    the number previously assigned(?)

    returns

    the object, if any, previous associated with the number

  34. def unregister(obj: IdentifiableEntity): Try[Int]

    Unregister a specific object.

    Unregister a specific object.

    obj

    an object being unregistered

    returns

    the number previously associated with the object

  35. def unregister_GetMonitorFromObject(obj: IdentifiableEntity, msg: String = "can not find this object"): Try[Int]

    Unregister a specific object by actually finding the object itself, if it exists.

    Unregister a specific object by actually finding the object itself, if it exists.

    obj

    an object being unregistered

    msg

    custom error message; has a vague default

    returns

    the number associated with this object

  36. def unregister_GetPoolFromObject(obj: IdentifiableEntity): Try[NumberPool]
  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  39. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped