mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 01:31:01 +00:00
Added abstraction for tracks, which are mapped to a specific items
This commit is contained in:
1 parent
df4710f34a
commit
187d0e9271
4 files changed
+110
No files matched your search
+20
@@ -0,0 +1,20 @@
|
||||
package com.sap.sailing.domain.tracking;
|
||||
|
||||
import com.sap.sse.common.Timed;
|
||||
|
||||
/**
|
||||
* {@link Track} specialization, which is mapped to a specific type of items.
|
||||
*
|
||||
* @param <ItemType>
|
||||
* the type of item this track is mapped to
|
||||
* @param <FixType>
|
||||
* the type of fix that is contained in this track
|
||||
*/
|
||||
public interface MappedTrack<ItemType, FixType extends Timed> extends Track<FixType> {
|
||||
|
||||
/**
|
||||
* @return the item this track is mapped to.
|
||||
*/
|
||||
ItemType getTrackedItem();
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.sap.sailing.domain.tracking.impl;
|
||||
|
||||
import com.sap.sailing.domain.tracking.MappedTrack;
|
||||
import com.sap.sse.common.Timed;
|
||||
import com.sap.sse.util.impl.ArrayListNavigableSet;
|
||||
|
||||
/**
|
||||
* Default implementation of {@link MappedTrack} interface.
|
||||
*
|
||||
* @param <ItemType>
|
||||
* the type of item this track is mapped to
|
||||
* @param <FixType>
|
||||
* the type of fix that is contained in this track
|
||||
*/
|
||||
public class MappedTrackImpl<ItemType, FixType extends Timed> extends TrackImpl<FixType>
|
||||
implements MappedTrack<ItemType, FixType> {
|
||||
|
||||
private static final long serialVersionUID = 6165693342087329096L;
|
||||
|
||||
private final ItemType trackedItem;
|
||||
|
||||
/** @see TrackImpl#TrackImpl(String) */
|
||||
public MappedTrackImpl(ItemType trackedItem, String nameForReadWriteLock) {
|
||||
super(nameForReadWriteLock);
|
||||
this.trackedItem = trackedItem;
|
||||
}
|
||||
|
||||
/** @see TrackImpl#TrackImpl(ArrayListNavigableSet, String) */
|
||||
protected MappedTrackImpl(ItemType trackedItem, ArrayListNavigableSet<Timed> fixes, String nameForReadWriteLock) {
|
||||
super(fixes, nameForReadWriteLock);
|
||||
this.trackedItem = trackedItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemType getTrackedItem() {
|
||||
return trackedItem;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user