public class TargetTracker extends Object implements Tracker
There are no automatically cleanup instead users must regularly cleanup targets by calling
removeAll(Predicate)
| Constructor and Description |
|---|
TargetTracker() |
| Modifier and Type | Method and Description |
|---|---|
int |
count(Predicate<? super AisPacketSource> predicate)
Returns the number of targets that is being tracked.
|
int |
countNumberOfReports()
Returns the total number of reports for all targets.
|
TargetInfo |
get(int mmsi)
Returns the latest target info for the specified MMSI number.
|
TargetInfo |
get(int mmsi,
Predicate<? super AisPacketSource> sourcePredicate)
Get target info.
|
Set<AisPacketSource> |
getPacketSourcesForMMSI(int mmsi)
Returns a set of all packet sources for a given MMSI number.
|
void |
removeAll(BiPredicate<? super AisPacketSource,? super TargetInfo> predicate)
Removes all targets that are accepted by the specified predicate.
|
void |
removeAll(Predicate<? super TargetInfo> predicate)
Removes all targets that are accepted by the specified predicate.
|
int |
size()
Returns the number of targets that is being tracked.
|
Stream<TargetInfo> |
stream()
Creates a parallel stream of all targets.
|
Stream<TargetInfo> |
stream(Predicate<? super AisPacketSource> sourcePredicate)
Creates a parallel stream of targets with the specified source predicate.
|
Stream<TargetInfo> |
stream(Predicate<? super AisPacketSource> sourcePredicate,
Predicate<? super TargetInfo> targetPredicate)
Creates a sequential stream of targets with the specified source predicate and matching the given targetPredicate.
|
Stream<TargetInfo> |
streamSequential()
Creates a sequential stream of all targets.
|
Stream<TargetInfo> |
streamSequential(Predicate<? super AisPacketSource> sourcePredicate)
Creates a sequential stream of targets with the specified source predicate.
|
Stream<TargetInfo> |
streamSequential(Predicate<? super AisPacketSource> sourcePredicate,
Predicate<? super TargetInfo> targetPredicate)
Creates a sequential stream of targets with the specified source predicate and matching the given targetPredicate.
|
void |
update(AisPacket packet)
Updates the tracker with the specified packet
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsubscribeToPacketReader, subscribeToPacketStreampublic int count(Predicate<? super AisPacketSource> predicate)
predicate - the predicatepublic int countNumberOfReports()
public TargetInfo get(int mmsi)
public TargetInfo get(int mmsi, Predicate<? super AisPacketSource> sourcePredicate)
mmsi - the mmsisourcePredicate - the source predicatepublic Set<AisPacketSource> getPacketSourcesForMMSI(int mmsi)
mmsi - the MMSI numberpublic void removeAll(Predicate<? super TargetInfo> predicate)
predicate - the predicate that selects which items to removepublic void removeAll(BiPredicate<? super AisPacketSource,? super TargetInfo> predicate)
predicate - the predicate that selects which items to removepublic int size()
size in interface Trackercount(Predicate)public Stream<TargetInfo> stream()
public Stream<TargetInfo> stream(Predicate<? super AisPacketSource> sourcePredicate)
sourcePredicate - the predicate on AIS packet sourcepublic Stream<TargetInfo> stream(Predicate<? super AisPacketSource> sourcePredicate, Predicate<? super TargetInfo> targetPredicate)
sourcePredicate - the source predicatetargetPredicate - the target predicatepublic Stream<TargetInfo> streamSequential()
public Stream<TargetInfo> streamSequential(Predicate<? super AisPacketSource> sourcePredicate)
sourcePredicate - the predicate on AIS packet sourcepublic Stream<TargetInfo> streamSequential(Predicate<? super AisPacketSource> sourcePredicate, Predicate<? super TargetInfo> targetPredicate)
sourcePredicate - the source predicatetargetPredicate - the target predicateCopyright © 2011–2019 Danish Maritime Authority. All rights reserved.