|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.helsinki.dacopan.model.DefaultDataView
public class DefaultDataView
Default DataView
implementation.
Note: this class is not thread-safe, it should be populated once and thereafter it can be accessed by multiple concurrent threads.
Field Summary | |
---|---|
protected java.util.Map |
endTimes
cached values for end times of each layer |
protected java.util.Map |
flows
flows by id |
protected java.util.Map |
hosts
hosts by id |
protected java.util.Map |
layers
layers by id |
protected java.util.Map |
layersToUnits
maps layers to lists of units on that level |
protected java.util.Map |
links
links by id |
protected java.util.Map |
protocols
protocols by id |
protected float |
scenarioEndTime
end time of the whole scenario |
protected java.util.Map |
units
all the transfer units by id |
protected java.util.Map |
variableLengths
maps variable definitions to the maximum lengths of their values |
Constructor Summary | |
---|---|
DefaultDataView()
|
Method Summary | |
---|---|
void |
addFlow(Flow flow)
Adds the given flow to this view. |
void |
addHost(Host host)
Adds the given host to this view. |
void |
addLayer(Layer layer)
Adds the given layer to this view. |
void |
addLink(Link link)
Adds the given link to this view. |
void |
addProtocol(Protocol protocol)
Adds the given protocol to this view. |
void |
addTransferUnit(TransferUnit unit,
boolean recurse)
Adds a transfer unit to the view. |
boolean |
equals(java.lang.Object o)
Mostly for unit testing purposes, does huge amounts of comparisons. |
java.util.List |
getAvailableVariables(Layer layer)
Returns a list of all the available variables (those that have values longer than zero characters) on the specified layer. |
float |
getEndTime()
Returns the end time of the network exchange data, as the timestamp of the last event included in the data, regardless of the type of event, layer etc. |
float |
getEndTimeForLayer(Layer layer)
Returns the end time of the network exchange data for a particular layer, as the timestamp of the last event in the layer. |
Flow |
getFlowById(long id)
Returns the flow by the given id, if any. |
java.util.List |
getFlows()
Returns all the flows present in the scenario. |
Host |
getHostById(long id)
Returns the host by the id. |
java.util.List |
getHosts()
Returns all the hosts present in the scenario. |
Layer |
getLayerById(long id)
Returns the layer with the given id. |
java.util.List |
getLayers()
Returns all the layers present in the scenario, ordered from lower to higher. |
Link |
getLinkById(long id)
Returns the link with the given id, if any. |
java.util.List |
getLinks()
Returns a list of all the links in the scenario. |
protected java.util.List |
getOrCreateUnitList(TransferUnit unit)
Gets the unit list for the layer of the specified unit, creates a new list if none exists. |
Protocol |
getProtocolById(long id)
Returns the protocol with the given id, if any. |
java.util.List |
getProtocols()
Returns all the protocols present. |
StepIterator |
getStepIterator(Layer layer)
Returns an iterator for the steps on
the specified layer. |
TransferUnit |
getUnitById(long id)
Returns the transfer unit with the given id, if any. |
java.util.List |
getUnitsForLayer(Layer layer)
Returns a sorted list of all the units in
the given layer. |
java.util.List |
getUnitsForLayer(Layer layer,
float start,
float end)
Returns a collection of all the units in
the given layer between the given timestamps (inclusive). |
int |
getValueMaxLength(VariableDefinition def)
Returns the maximum length of all the values of the given variable. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map hosts
protected java.util.Map flows
protected java.util.Map links
protected java.util.Map layers
protected java.util.Map protocols
protected java.util.Map units
protected java.util.Map layersToUnits
protected java.util.Map endTimes
protected float scenarioEndTime
protected java.util.Map variableLengths
Constructor Detail |
---|
public DefaultDataView()
Method Detail |
---|
protected java.util.List getOrCreateUnitList(TransferUnit unit)
public void addHost(Host host)
DataView
addHost
in interface DataView
public void addFlow(Flow flow)
DataView
addFlow
in interface DataView
public void addLink(Link link)
DataView
addLink
in interface DataView
public void addLayer(Layer layer)
DataView
addLayer
in interface DataView
public void addProtocol(Protocol protocol)
DataView
addProtocol
in interface DataView
public void addTransferUnit(TransferUnit unit, boolean recurse)
DataView
recurse
is
true, the method will recurse to the children of the unit and
add them to the view as well.
addTransferUnit
in interface DataView
unit
- to addrecurse
- whether to recursepublic java.util.List getUnitsForLayer(Layer layer)
DataView
units
in
the given layer.
getUnitsForLayer
in interface DataView
layer
- whose units to returnpublic java.util.List getUnitsForLayer(Layer layer, float start, float end)
DataView
units
in
the given layer between the given timestamps (inclusive).
getUnitsForLayer
in interface DataView
layer
- whose units to returnstart
- timestampsend
- timestampspublic TransferUnit getUnitById(long id)
DataView
getUnitById
in interface DataView
public java.util.List getHosts()
DataView
hosts
present in the scenario.
getHosts
in interface DataView
public Host getHostById(long id)
DataView
getHostById
in interface DataView
public java.util.List getFlows()
DataView
flows
present in the scenario.
getFlows
in interface DataView
public Flow getFlowById(long id)
DataView
getFlowById
in interface DataView
public java.util.List getLayers()
DataView
getLayers
in interface DataView
public Layer getLayerById(long id)
DataView
getLayerById
in interface DataView
public java.util.List getProtocols()
DataView
getProtocols
in interface DataView
public Protocol getProtocolById(long id)
DataView
getProtocolById
in interface DataView
public java.util.List getLinks()
DataView
links
in the scenario.
getLinks
in interface DataView
public Link getLinkById(long id)
DataView
getLinkById
in interface DataView
public int getValueMaxLength(VariableDefinition def)
DataView
getValueMaxLength
in interface DataView
public java.util.List getAvailableVariables(Layer layer)
DataView
getAvailableVariables
in interface DataView
public StepIterator getStepIterator(Layer layer)
DataView
iterator
for the steps on
the specified layer.
getStepIterator
in interface DataView
layer
- to step thru
public float getEndTime()
DataView
getEndTime
in interface DataView
public float getEndTimeForLayer(Layer layer)
DataView
getEndTimeForLayer
in interface DataView
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |