trait ModelImpl[U] extends Model[U]
A straight forward implementation of a model. The trait implements all required methods and
provides a dispatch method to fire any updates.
- Alphabetic
- By Inheritance
- ModelImpl
- Model
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addListener(pf: Model.Listener[U]): pf.type
Registers a listener for updates from the model.
Registers a listener for updates from the model. A listener is simply a partial function which receives instances of
U. Therefore the listener can decide with pattern match cases which updates it wants to handle.Example:
m.addListener { case NcviewSync.Open(path) => ... }Note: If the listener should be removed at some point, it is important to store it somewhere:
val l: NcviewSync.Listener = { case NcviewSync.Open(path) => ... } m.addListener(l) ... m.removeListener(l)
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
dispatch(update: U): Unit
Synchronously dispatches an update to all currently registered listeners.
Synchronously dispatches an update to all currently registered listeners. Non fatal exceptions are caught on a per-listener basis without stopping the dispatch.
- Attributes
- protected
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
releaseListeners(): Unit
Removes all listeners.
Removes all listeners. This is useful when disposing the model, to remove any unnecessary references.
- Attributes
- protected
-
def
removeListener(pf: Model.Listener[U]): Unit
Unregisters a listener for updates from the model.
-
def
startListening(): Unit
Subclasses can override this to issue particular actions when the first listener has been registered
Subclasses can override this to issue particular actions when the first listener has been registered
- Attributes
- protected
-
def
stopListening(): Unit
Subclasses can override this to issue particular actions when the last listener has been unregistered
Subclasses can override this to issue particular actions when the last listener has been unregistered
- Attributes
- protected
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )