public final class Query extends Object implements Identifiable
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
Query(Sampler<?> sampler,
String description,
MetaDataSet metaDataSet) |
Query(Sampler<?> sampler,
String description,
MetaDataSet metaDataSet,
Duration interval) |
Query(Sampler<?> sampler,
String description,
MetaDataSet metaDataSet,
Frequency updateFrequency) |
Query(Sampler<?> sampler,
String description,
MetaDataSet metaDataSet,
Frequency updateFrequency,
Duration interval) |
Query(Sampler<?> sampler,
String id,
String description,
MetaDataSet metaDataSet) |
Query(Sampler<?> sampler,
String id,
String description,
MetaDataSet metaDataSet,
Duration interval) |
Query(Sampler<?> sampler,
String id,
String description,
MetaDataSet metaDataSet,
Frequency updateFrequency) |
Query(Sampler<?> sampler,
String id,
String description,
MetaDataSet metaDataSet,
Frequency updateFrequency,
Duration interval) |
Modifier and Type | Method and Description |
---|---|
void |
addSpaceTimeRegion(KpiLaneDirection laneDirection,
Length startPosition,
Length endPosition,
Time startTime,
Time endTime)
Defines a region in space and time for which this query is valid.
|
void |
addSpaceTimeRegionLink(LinkDataInterface link,
KpiGtuDirectionality direction,
Length startPosition,
Length endPosition,
Time startTime,
Time endTime)
Defines a region in space and time for which this query is valid.
|
boolean |
equals(Object obj) |
String |
getDescription() |
String |
getId()
return the unique id for the query.
|
Duration |
getInterval() |
Iterator<Map.Entry<MetaDataType<?>,Set<?>>> |
getMetaDataSetIterator() |
Sampler<?> |
getSampler() |
Iterator<SpaceTimeRegion> |
getSpaceTimeIterator() |
<T> List<TrajectoryGroup> |
getTrajectoryGroups(Time endTime)
Returns a list of TrajectoryGroups in accordance with the query.
|
<T> List<TrajectoryGroup> |
getTrajectoryGroups(Time startTime,
Time endTime)
Returns a list of TrajectoryGroups in accordance with the query.
|
Frequency |
getUpdateFrequency() |
int |
hashCode() |
int |
metaDataSize() |
int |
spaceTimeRegionSize() |
String |
toString() |
public Query(Sampler<?> sampler, String id, String description, MetaDataSet metaDataSet)
sampler
- samplerid
- iddescription
- descriptionmetaDataSet
- meta dataNullPointerException
- if sampling, description or metaDataSet is nullpublic Query(Sampler<?> sampler, String id, String description, MetaDataSet metaDataSet, Duration interval)
sampler
- samplerid
- iddescription
- descriptionmetaDataSet
- meta datainterval
- interval to gather statistics overNullPointerException
- if sampling, description or metaDataSet is nullpublic Query(Sampler<?> sampler, String id, String description, MetaDataSet metaDataSet, Frequency updateFrequency)
sampler
- samplerid
- iddescription
- descriptionmetaDataSet
- meta dataupdateFrequency
- update frequencyNullPointerException
- if sampling, description or metaDataSet is nullpublic Query(Sampler<?> sampler, String id, String description, MetaDataSet metaDataSet, Frequency updateFrequency, Duration interval)
sampler
- samplerid
- iddescription
- descriptionmetaDataSet
- meta dataupdateFrequency
- update frequencyinterval
- interval to gather statistics overNullPointerException
- if sampling, description or metaDataSet is nullpublic Query(Sampler<?> sampler, String description, MetaDataSet metaDataSet)
sampler
- samplerdescription
- descriptionmetaDataSet
- meta dataNullPointerException
- if sampling, description or metaDataSet is nullpublic Query(Sampler<?> sampler, String description, MetaDataSet metaDataSet, Duration interval)
sampler
- samplerdescription
- descriptionmetaDataSet
- meta datainterval
- interval to gather statistics overNullPointerException
- if sampling, description or metaDataSet is nullpublic Query(Sampler<?> sampler, String description, MetaDataSet metaDataSet, Frequency updateFrequency)
sampler
- samplerdescription
- descriptionmetaDataSet
- meta dataupdateFrequency
- update frequencyNullPointerException
- if sampling, description or metaDataSet is nullpublic Query(Sampler<?> sampler, String description, MetaDataSet metaDataSet, Frequency updateFrequency, Duration interval)
sampler
- samplerdescription
- descriptionmetaDataSet
- meta dataupdateFrequency
- update frequencyinterval
- interval to gather statistics overNullPointerException
- if sampling, description or metaDataSet is nullpublic String getId()
getId
in interface Identifiable
public String getDescription()
public Frequency getUpdateFrequency()
public Duration getInterval()
public int metaDataSize()
public Iterator<Map.Entry<MetaDataType<?>,Set<?>>> getMetaDataSetIterator()
public void addSpaceTimeRegionLink(LinkDataInterface link, KpiGtuDirectionality direction, Length startPosition, Length endPosition, Time startTime, Time endTime)
link
- linkdirection
- directionstartPosition
- start positionendPosition
- end positionstartTime
- start timeendTime
- end timepublic void addSpaceTimeRegion(KpiLaneDirection laneDirection, Length startPosition, Length endPosition, Time startTime, Time endTime)
laneDirection
- lane directionstartPosition
- start positionendPosition
- end positionstartTime
- start timeendTime
- end timepublic int spaceTimeRegionSize()
public Iterator<SpaceTimeRegion> getSpaceTimeIterator()
public <T> List<TrajectoryGroup> getTrajectoryGroups(Time endTime)
TrajectoryGroup
contains Trajectory
objects pertaining to a SpaceTimeRegion
from the query. A Trajectory
is only included if all the meta
data of this query accepts the trajectory. This method uses Time.ZERO
as start.T
- underlying class of meta data type and its valueendTime
- end time of interval to get trajectory groups forpublic <T> List<TrajectoryGroup> getTrajectoryGroups(Time startTime, Time endTime)
TrajectoryGroup
contains Trajectory
objects pertaining to a SpaceTimeRegion
from the query. A Trajectory
is only included if all the meta
data of this query accepts the trajectory.T
- underlying class of meta data type and its valuestartTime
- start time of interval to get trajectory groups forendTime
- start time of interval to get trajectory groups forpublic Sampler<?> getSampler()
Copyright © 2014–2018 Delft University of Technology. All rights reserved.