Package adams.flow.core
Class ActorStatistic
- java.lang.Object
-
- adams.flow.core.ActorStatistic
-
- All Implemented Interfaces:
SpreadSheetSupporter
,InformativeStatistic
public class ActorStatistic extends Object implements InformativeStatistic
Generates some statistics for an actor.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static String
COUNT_ACTORS
the overall count.static String
COUNT_CONTROLACTORS
the control actor count.static String
COUNT_SINKS
the sink count.static String
COUNT_SKIPPED
the skipped count (includes sub-flows).static String
COUNT_SKIPPED_FLAG_SET
the skipped count (flag only).static String
COUNT_SOURCES
the source count.static String
COUNT_STANDALONES
the standalone count.static String
COUNT_TRANSFORMERS
the transformer count.protected Actor
m_Actor
the actor to create the statistics for.protected NamedCounter
m_ClassStatistics
the statistics per actor class.protected NamedCounter
m_TypeStatistics
the statistics per actor type.
-
Constructor Summary
Constructors Constructor Description ActorStatistic()
Initializes the statistics.ActorStatistic(Actor actor)
Initializes the statistics with the specified actor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
calculate()
Generates the statistics.Actor
getActor()
Returns the underlying actor.double
getStatistic(String name)
Returns the statistical value for the given statistic name.String
getStatisticDescription()
Returns a description for this statistic.protected boolean
isSkipped(Actor actor)
Checks whether the actor itself or one of its parents is skipped.void
setActor(Actor value)
Sets the actor to generate the statistics for.Iterator<String>
statisticNames()
Returns all the names of the available statistical values.SpreadSheet
toSpreadSheet()
Returns the content as spreadsheet.String
toString()
Returns a string representation of the statistic.void
update(Actor actor)
Updates the statistics with the specified actor.
-
-
-
Field Detail
-
COUNT_ACTORS
public static String COUNT_ACTORS
the overall count.
-
COUNT_CONTROLACTORS
public static String COUNT_CONTROLACTORS
the control actor count.
-
COUNT_STANDALONES
public static String COUNT_STANDALONES
the standalone count.
-
COUNT_SOURCES
public static String COUNT_SOURCES
the source count.
-
COUNT_TRANSFORMERS
public static String COUNT_TRANSFORMERS
the transformer count.
-
COUNT_SINKS
public static String COUNT_SINKS
the sink count.
-
COUNT_SKIPPED
public static String COUNT_SKIPPED
the skipped count (includes sub-flows).
-
COUNT_SKIPPED_FLAG_SET
public static String COUNT_SKIPPED_FLAG_SET
the skipped count (flag only).
-
m_TypeStatistics
protected NamedCounter m_TypeStatistics
the statistics per actor type.
-
m_ClassStatistics
protected NamedCounter m_ClassStatistics
the statistics per actor class.
-
m_Actor
protected Actor m_Actor
the actor to create the statistics for.
-
-
Constructor Detail
-
ActorStatistic
public ActorStatistic()
Initializes the statistics.
-
ActorStatistic
public ActorStatistic(Actor actor)
Initializes the statistics with the specified actor.- Parameters:
actor
- the actor to generate the stats for
-
-
Method Detail
-
setActor
public void setActor(Actor value)
Sets the actor to generate the statistics for.- Parameters:
value
- the actor to use
-
getActor
public Actor getActor()
Returns the underlying actor.- Returns:
- the actor, null if none set
-
isSkipped
protected boolean isSkipped(Actor actor)
Checks whether the actor itself or one of its parents is skipped.- Parameters:
actor
- the actor to check- Returns:
- if itself or a parent is skipped
-
update
public void update(Actor actor)
Updates the statistics with the specified actor.- Parameters:
actor
- the actor to use
-
calculate
protected void calculate()
Generates the statistics.
-
getStatisticDescription
public String getStatisticDescription()
Returns a description for this statistic.- Specified by:
getStatisticDescription
in interfaceInformativeStatistic
- Returns:
- the description
-
statisticNames
public Iterator<String> statisticNames()
Returns all the names of the available statistical values.- Specified by:
statisticNames
in interfaceInformativeStatistic
- Returns:
- the enumeration of names
-
getStatistic
public double getStatistic(String name)
Returns the statistical value for the given statistic name.- Specified by:
getStatistic
in interfaceInformativeStatistic
- Parameters:
name
- the name of the statistical value- Returns:
- the corresponding value
-
toString
public String toString()
Returns a string representation of the statistic.
-
toSpreadSheet
public SpreadSheet toSpreadSheet()
Returns the content as spreadsheet.- Specified by:
toSpreadSheet
in interfaceSpreadSheetSupporter
- Returns:
- the content
-
-