Trait

net.psforever.objects.guid.source

NumberSource

Related Doc: package source

Permalink

trait NumberSource extends AnyRef

A NumberSource is considered a master "pool" of numbers from which all numbers are available to be drawn. The numbers are considered to be exclusive.

The following are guidelines for implementing classes. The numbers allocated to this source are from zero up through positive integers. When a number is drawn from the pool, it is flagged internally and can not be selected for drawing again until the flag is removed. Some flagging states are allowed to restrict that number for the whole lifespan of the source. This internal flagging is maintained by a "monitor" that should not directly get exposed. Use the provided indirect referencing containers - SecureKey and LoanedKey.

The purpose of a NumberSource is to help facilitate globally unique identifiers (GUID, pl. GUIDs).

Source
NumberSource.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NumberSource
  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

Abstract Value Members

  1. abstract def Available(number: Int): Option[LoanedKey]

    Permalink

    Produce a modifiable wrapper for the Monitor for this number, only if the number has not been used.

    Produce a modifiable wrapper for the Monitor for this number, only if the number has not been used. The Monitor should be updated before being wrapped, if necessary.

    number

    the number

    returns

    the wrapped Monitor, or None

  2. abstract def Clear(): List[IdentifiableEntity]

    Permalink

    Reset all number Monitors so that their underlying number is not longer treated as assigned.

    Reset all number Monitors so that their underlying number is not longer treated as assigned. Perform some level of housecleaning to ensure that all dependencies are resolved in some manner. This is the only way to free Monitors that are marked as Restricted.

    returns

    a List of assignments maintained by all the currently-used number Monitors

  3. abstract def CountAvailable: Int

    Permalink

    The count of numbers that can still be drawn.

    The count of numbers that can still be drawn.

    returns

    the count

  4. abstract def CountUsed: Int

    Permalink

    The count of numbers that can not be drawn.

    The count of numbers that can not be drawn.

    returns

    the count

  5. abstract def FinalizeRestrictions: List[Int]

    Permalink

    Numbers from this source may not longer be marked as Restricted.

    Numbers from this source may not longer be marked as Restricted.

    returns

    the List of all numbers that have been restricted

  6. abstract def Get(number: Int): Option[SecureKey]

    Permalink

    Produce an un-modifiable wrapper for the Monitor for this number.

    Produce an un-modifiable wrapper for the Monitor for this number.

    number

    the number

    returns

    the wrapped Monitor

  7. abstract def Restrict(number: Int): Option[LoanedKey]

    Permalink

    Produce a modifiable wrapper for the Monitor for this number, only if the number has not been used.

    Produce a modifiable wrapper for the Monitor for this number, only if the number has not been used. This wrapped Monitor can only be assigned once and the number may not be Returned to this source.

    number

    the number

    returns

    the wrapped Monitor

  8. abstract def Return(number: Int): Option[IdentifiableEntity]

    Permalink

    Consume the number of a Monitor and release that number from its previous assignment/use.

    Consume the number of a Monitor and release that number from its previous assignment/use.

    number

    the number

    returns

    any object previously using this number

  9. abstract def Size: Int

    Permalink

    The count of numbers allocated to this source.

    The count of numbers allocated to this source.

    returns

    the count

Concrete 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 NumberSource to any2stringadd[NumberSource] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (NumberSource, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from NumberSource to ArrowAssoc[NumberSource] 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 Return(monitor: LoanedKey): Option[IdentifiableEntity]

    Permalink

    Consume a wrapped Monitor and release its number from its previous assignment/use.

    Consume a wrapped Monitor and release its number from its previous assignment/use.

    monitor

    the Monitor

    returns

    any object previously using this Monitor

  7. def Return(monitor: SecureKey): Option[IdentifiableEntity]

    Permalink

    Consume a wrapped Monitor and release its number from its previous assignment/use.

    Consume a wrapped Monitor and release its number from its previous assignment/use.

    monitor

    the Monitor

    returns

    any object previously using this Monitor

  8. def Test(number: Int): Boolean

    Permalink

    Is this number a member of this number source?

    Is this number a member of this number source?

    number

    the number

    returns

    true, if it is a member; false, otherwise

  9. final def asInstanceOf[T0]: T0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  25. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit

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

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

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

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

Inherited from AnyRef

Inherited from Any

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

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

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

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

Ungrouped