-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added base classes for event handling
- Loading branch information
1 parent
b222ab9
commit cdc44a0
Showing
4 changed files
with
51 additions
and
24 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
ical4j-connector-api/src/main/java/org/ical4j/connector/AbstractObjectCollection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.ical4j.connector; | ||
|
||
import org.ical4j.connector.event.ListenerList; | ||
import org.ical4j.connector.event.ObjectCollectionListener; | ||
|
||
public abstract class AbstractObjectCollection<T> implements ObjectCollection<T> { | ||
|
||
private final ListenerList<ObjectCollectionListener<T>> listenerList; | ||
|
||
public AbstractObjectCollection() { | ||
this(new ListenerList<>()); | ||
} | ||
|
||
public AbstractObjectCollection(ListenerList<ObjectCollectionListener<T>> listenerList) { | ||
this.listenerList = listenerList; | ||
} | ||
|
||
@Override | ||
public ListenerList<ObjectCollectionListener<T>> getObjectCollectionListeners() { | ||
return listenerList; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
ical4j-connector-api/src/main/java/org/ical4j/connector/AbstractObjectStore.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.ical4j.connector; | ||
|
||
import org.ical4j.connector.event.ListenerList; | ||
import org.ical4j.connector.event.ObjectStoreListener; | ||
|
||
public abstract class AbstractObjectStore<T, C extends ObjectCollection<T>> implements ObjectStore<T, C> { | ||
|
||
/** | ||
* Registered event listeners. | ||
*/ | ||
private final ListenerList<ObjectStoreListener<T>> listenerList; | ||
|
||
public AbstractObjectStore() { | ||
this(new ListenerList<>()); | ||
} | ||
|
||
public AbstractObjectStore(ListenerList<ObjectStoreListener<T>> listenerList) { | ||
this.listenerList = listenerList; | ||
} | ||
|
||
@Override | ||
public ListenerList<ObjectStoreListener<T>> getObjectStoreListeners() { | ||
return listenerList; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters