Class

net.psforever.objects.guid

NumberPoolHub

Related Doc: package guid

Permalink

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
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NumberPoolHub(source: NumberSource)

    Permalink

    source

    the number source object

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from NumberPoolHub to any2stringadd[NumberPoolHub] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (NumberPoolHub, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from NumberPoolHub to ArrowAssoc[NumberPoolHub] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def AddPool(name: String, pool: List[Int]): NumberPool

    Permalink

    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

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

    Permalink

    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

  8. def Numbers: List[Int]

    Permalink
  9. def Pools: HashMap[String, NumberPool]

    Permalink

    na

    na

    returns

    na

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

    Permalink

    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)

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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).

    number

    the unique number to attempt to retrieve from the source

    returns

    the object that is assigned to the number

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

    Permalink

    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).

    number

    the unique number to attempt to retrieve from the source

    returns

    the object that is assigned to the number

  15. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  16. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. def ensuring(cond: (NumberPoolHub) ⇒ Boolean, msg: ⇒ Any): NumberPoolHub

    Permalink
    Implicit information
    This member is added by an implicit conversion from NumberPoolHub to Ensuring[NumberPoolHub] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: (NumberPoolHub) ⇒ Boolean): NumberPoolHub

    Permalink
    Implicit information
    This member is added by an implicit conversion from NumberPoolHub to Ensuring[NumberPoolHub] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: Boolean, msg: ⇒ Any): NumberPoolHub

    Permalink
    Implicit information
    This member is added by an implicit conversion from NumberPoolHub to Ensuring[NumberPoolHub] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def ensuring(cond: Boolean): NumberPoolHub

    Permalink
    Implicit information
    This member is added by an implicit conversion from NumberPoolHub to Ensuring[NumberPoolHub] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from NumberPoolHub to StringFormat[NumberPoolHub] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  28. def isRegistered(number: Int): Boolean

    Permalink

    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)

  29. def isRegistered(obj: IdentifiableEntity): Boolean

    Permalink

    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)

  30. def latterPartRegister(obj: IdentifiableEntity, number: Int): Try[IdentifiableEntity]

    Permalink

    na

    na

    obj

    an object being registered

    number

    the number whose assignment is requested

    returns

    an object that has been registered

  31. def latterPartUnregister(number: Int): Option[IdentifiableEntity]

    Permalink

    For accessing the Return function of the contained NumberSource directly.

    For accessing the Return function of the contained NumberSource directly.

    number

    the number to return.

    returns

    any object previously using this number

  32. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. def register(name: String): Try[LoanedKey]

    Permalink

    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

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

    Permalink

    Register a specific number.

    Register a specific number.

    number

    the number whose assignment is requested

    returns

    the monitor for a number

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  42. def unregister(number: Int): Try[Option[IdentifiableEntity]]

    Permalink

    Unregister a specific number.

    Unregister a specific number.

    number

    the number previously assigned(?)

    returns

    the object, if any, previous associated with the number

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

    Permalink

    Unregister a specific object.

    Unregister a specific object.

    obj

    an object being unregistered

    returns

    the number previously associated with the object

  44. def unregister_GetPoolFromObject(obj: IdentifiableEntity): Try[NumberPool]

    Permalink
  45. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. def [B](y: B): (NumberPoolHub, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from NumberPoolHub to ArrowAssoc[NumberPoolHub] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from NumberPoolHub to any2stringadd[NumberPoolHub]

Inherited by implicit conversion StringFormat from NumberPoolHub to StringFormat[NumberPoolHub]

Inherited by implicit conversion Ensuring from NumberPoolHub to Ensuring[NumberPoolHub]

Inherited by implicit conversion ArrowAssoc from NumberPoolHub to ArrowAssoc[NumberPoolHub]

Ungrouped