fi.helsinki.dacopan.model
Interface DataView

All Known Implementing Classes:
DefaultDataView

public interface DataView

Provides different views to the core data structures. TODO consider using Collection instead of List for every method whose return value doesn't explicitly require a List

Version:
$Id: DataView.java,v 1.15 2004/05/11 09:21:05 aarniala-dacopan Exp $

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.
 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.
 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.
 

Method Detail

addHost

void addHost(Host host)
Adds the given host to this view.


addFlow

void addFlow(Flow flow)
Adds the given flow to this view.


addLink

void addLink(Link link)
Adds the given link to this view.


addLayer

void addLayer(Layer layer)
Adds the given layer to this view.


addProtocol

void addProtocol(Protocol protocol)
Adds the given protocol to this view.


addTransferUnit

void addTransferUnit(TransferUnit unit,
                     boolean recurse)
Adds a transfer unit to the view. If recurse is true, the method will recurse to the children of the unit and add them to the view as well.

Parameters:
unit - to add
recurse - whether to recurse

getUnitsForLayer

java.util.List getUnitsForLayer(Layer layer)
Returns a sorted list of all the units in the given layer.

Parameters:
layer - whose units to return

getUnitsForLayer

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).

Parameters:
layer - whose units to return
start - timestamps
end - timestamps

getUnitById

TransferUnit getUnitById(long id)
Returns the transfer unit with the given id, if any.


getStepIterator

StepIterator getStepIterator(Layer layer)
Returns an iterator for the steps on the specified layer.

Parameters:
layer - to step thru
Returns:
iterator for stepping

getEndTime

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.


getEndTimeForLayer

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.


getValueMaxLength

int getValueMaxLength(VariableDefinition def)
Returns the maximum length of all the values of the given variable.


getAvailableVariables

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.


getHosts

java.util.List getHosts()
Returns all the hosts present in the scenario.


getHostById

Host getHostById(long id)
Returns the host by the id.


getFlows

java.util.List getFlows()
Returns all the flows present in the scenario.


getFlowById

Flow getFlowById(long id)
Returns the flow by the given id, if any.


getLayers

java.util.List getLayers()
Returns all the layers present in the scenario, ordered from lower to higher. (for instance Network -> Transport -> Application)


getLayerById

Layer getLayerById(long id)
Returns the layer with the given id.


getProtocols

java.util.List getProtocols()
Returns all the protocols present.


getProtocolById

Protocol getProtocolById(long id)
Returns the protocol with the given id, if any.


getLinks

java.util.List getLinks()
Returns a list of all the links in the scenario.


getLinkById

Link getLinkById(long id)
Returns the link with the given id, if any.



© Dacopan2 team, 2005-