goog.Disposable | |
goog.testing.MockRandom | goog.Disposable |
sequence
: Array.<number>
The sequence of numbers to return.
|
opt_install
: boolean=
Whether to install the MockRandom at
construction time.
|
![]()
No description.
|
code » | ||
No description.
Returns: boolean
Whether there are more numbers left in the sequence.
|
code » | ||
![]()
Injects new numbers into the beginning of the sequence.
|
code » | ||
![]()
Installs this MockRandom as the system number generator.
|
code » | ||
![]()
The original Math.random function.
|
code » | ||
No description.
Returns: number
The next number in the sequence. If there are no more values
left, this will return a random number, unless
this.strictlyFromSequence_ is true, in which case an error will
be thrown.
|
code » | ||
![]()
No description.
Arguments:
|
code » | ||
![]()
Uninstalls the MockRandom.
|
code » |
![]()
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
![]()
Disposes of the object. If the object hasn't already been disposed of, calls
#disposeInternal . Classes that extend goog.Disposable should
override #disposeInternal in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void
Nothing.
|
code » | |||
![]()
Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend
goog.Disposable should
override this method.
Not reentrant. To avoid calling it twice, it must only be called from the
subclass' disposeInternal method. Everywhere else the public
dispose method must be used.
For example:
mypackage.MyClass = function() { mypackage.MyClass.base(this, 'constructor'); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { // Dispose logic specific to MyClass. ... // Call superclass's disposeInternal at the end of the subclass's, like // in C++, to avoid hard-to-catch issues. mypackage.MyClass.base(this, 'disposeInternal'); }; |
code » | |||
Use
#isDisposed instead.
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
![]()
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
![]()
No description.
|
Code » | |
![]()
Whether this MockRandom has been installed.
|
Code » | |
![]()
The sequence of numbers to be returned by calls to random()
|
Code » | |
![]()
Whether to throw an exception when Math.random() is called when there is
nothing left in the sequence.
|
Code » |
![]()
No description.
|
Code » |