Package arez
Interface Disposable
- All Known Implementing Classes:
Component
,ComponentKernel
,ComputableValue
,DocumentVisibility
,MemoizeCache
,Node
,ObservableValue
,Observer
,SchedulerLock
,Task
public interface Disposable
Interface that allows caller to release any resources associated with element.
It is safe to invoke
dispose()
multiple times on a element. Once an
element is disposed, no methods should be invoked on element.-
Method Summary
Modifier and TypeMethodDescriptionstatic Disposable
asDisposable
(Object object) Cast specified object to instance of Disposable.void
dispose()
Dispose the element.static void
Dispose the supplied object if it is Disposable, else do nothing.boolean
Return true if dispose() has been called on object.static boolean
isDisposed
(Object object) Return true if the parameter is Disposable and has been disposed, else return false.default boolean
Return true ifisDisposed()
returns false.static boolean
isNotDisposed
(Object object) Return true ifisDisposed(Object)
returns false for the same parameter.
-
Method Details
-
dispose
void dispose()Dispose the element. SeeDisposable
for a description of the implications. -
isDisposed
boolean isDisposed()Return true if dispose() has been called on object.- Returns:
- true if dispose has been called.
-
isNotDisposed
Return true ifisDisposed()
returns false.- Returns:
- true if
isDisposed()
returns false.
-
dispose
Dispose the supplied object if it is Disposable, else do nothing.- Parameters:
object
- the object to dispose.
-
isDisposed
Return true if the parameter is Disposable and has been disposed, else return false.- Parameters:
object
- the object to check disposed state.- Returns:
- true if the parameter is Disposable and has been disposed, else return false.
-
isNotDisposed
Return true ifisDisposed(Object)
returns false for the same parameter.- Parameters:
object
- the object to check state.- Returns:
- true if the parameter is not Disposable or has not been disposed, else return false.
-
asDisposable
Cast specified object to instance of Disposable. Invariant checks will verify that the cast is valid before proceeding.- Parameters:
object
- the object to cast to Disposable.- Returns:
- the object cast to Disposable.
-