public class

ModelEvent

extends Object
java.lang.Object
   ↳ fm.audiobox.core.models.collections.ModelEvent<E>

Class Overview

This is the wrapper object sent to the observers.

It contains information about what happened, the item that triggered the event and the item the event impacted (i.e. the list).

Summary

Constants
int ADD An item is added to the collection.
int CLEAR The collection is cleared.
int REMOVE An item is removed from the collection.
Fields
public E source The item that triggered the event.
public EventedModelList target The object where the event is originated.
public int what The type of the event (see ADD, REMOVE and CLEAR).
Public Constructors
ModelEvent(int what, E source, EventedModelList target, Model notifiers)
Instantiates a new Event.
Public Methods
void trigger()
Notifies parents observers
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int ADD

An item is added to the collection.

Constant Value: 1 (0x00000001)

public static final int CLEAR

The collection is cleared.

Constant Value: 0 (0x00000000)

public static final int REMOVE

An item is removed from the collection.

Constant Value: -1 (0xffffffff)

Fields

public E source

The item that triggered the event.

public EventedModelList target

The object where the event is originated.

public int what

The type of the event (see ADD, REMOVE and CLEAR).

Public Constructors

public ModelEvent (int what, E source, EventedModelList target, Model notifiers)

Instantiates a new Event.

Parameters
what the type of the event (see ADD, REMOVE and CLEAR).
source the item that triggered the event.
target the object where the event is originated (can be null).
notifiers the model to notify the event to.

Public Methods

public void trigger ()

Notifies parents observers