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 StringCOUNT_ACTORSthe overall count.static StringCOUNT_CONTROLACTORSthe control actor count.static StringCOUNT_SINKSthe sink count.static StringCOUNT_SKIPPEDthe skipped count (includes sub-flows).static StringCOUNT_SKIPPED_FLAG_SETthe skipped count (flag only).static StringCOUNT_SOURCESthe source count.static StringCOUNT_STANDALONESthe standalone count.static StringCOUNT_TRANSFORMERSthe transformer count.protected Actorm_Actorthe actor to create the statistics for.protected NamedCounterm_ClassStatisticsthe statistics per actor class.protected NamedCounterm_TypeStatisticsthe 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 voidcalculate()Generates the statistics.ActorgetActor()Returns the underlying actor.doublegetStatistic(String name)Returns the statistical value for the given statistic name.StringgetStatisticDescription()Returns a description for this statistic.protected booleanisSkipped(Actor actor)Checks whether the actor itself or one of its parents is skipped.voidsetActor(Actor value)Sets the actor to generate the statistics for.Iterator<String>statisticNames()Returns all the names of the available statistical values.SpreadSheettoSpreadSheet()Returns the content as spreadsheet.StringtoString()Returns a string representation of the statistic.voidupdate(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:
getStatisticDescriptionin interfaceInformativeStatistic- Returns:
- the description
-
statisticNames
public Iterator<String> statisticNames()
Returns all the names of the available statistical values.- Specified by:
statisticNamesin interfaceInformativeStatistic- Returns:
- the enumeration of names
-
getStatistic
public double getStatistic(String name)
Returns the statistical value for the given statistic name.- Specified by:
getStatisticin 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:
toSpreadSheetin interfaceSpreadSheetSupporter- Returns:
- the content
-
-