pl.edu.agh.cast.model.visual.backward
Class Statistic

java.lang.Object
  extended by pl.edu.agh.cast.model.visual.backward.Statistic

public class Statistic
extends Object

The Statistics class represents single row of statistics of given domain model, which corresponds to single graph node. The important properties of the default statistics are:

There are helper methods which provide string representations of the properties, which are numbers. Domain statistics may provide different meaning for these properties (e.g. the number of sent and received short messages, the amount of money transfered, etc.) There is also one special type of statistics - the summary row. It doesn't correspond to any graph node, but summarizes the statistics. It appears at the end of the statistics, and by default contains the total number of nodes and total number of source and target edges. This row is indicated by the isSummary flag. The row is constructed by the statistics dialog, so should not be provided by domain-specific statistic providers.

Author:
AGH CAST Team

Constructor Summary
Statistic(String nodeName)
          Creates new statistics with no values.
Statistic(String nodeName, double outgoing, double incoming)
          Creates new statistics of double values.
Statistic(String nodeName, int outgoing, int incoming)
          Creates new statistics of integer values.
 
Method Summary
 boolean equals(Object other)
          
 String getNodeName()
          Returns the name of the node which correspond to this statistics row.
 double getSource()
          Returns the value of the statistics for the source edges.
 String getSourceLabel()
          Returns the label (i.e.
 double getTarget()
          Returns the value of the statistics for the target edges.
 String getTargetLabel()
          Returns the label (i.e.
 double getTotal()
          Returns the total value of the statistics row.
 String getTotalLabel()
          Returns the label of the total value of the statistics row.
 int hashCode()
          
 boolean isSummary()
          Is the statistic row a special (summary) row? It will always appear at the end of the statistics dialog.
 void setNodeName(String nodeName)
          Sets the name of the node which correspond to this statistics row.
 void setSource(double outgoing)
          Sets the value of the statistics for the source edges.
 void setSummary(boolean value)
          Set the summary flag.
 void setTarget(double incoming)
          Sets the value of the statistics for the target edges.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Statistic

public Statistic(String nodeName,
                 int outgoing,
                 int incoming)
Creates new statistics of integer values.

Parameters:
nodeName - the name of the node which correspond to this statistics row; may not be null
outgoing - the value of the statistics for the source edges
incoming - the value of the statistics for the target edges
Throws:
IllegalArgumentException - if node name is null

Statistic

public Statistic(String nodeName,
                 double outgoing,
                 double incoming)
Creates new statistics of double values.

Parameters:
nodeName - the name of the node which correspond to this statistics row; may not be null
outgoing - the value of the statistics for the source edges
incoming - the value of the statistics for the target edges
Throws:
IllegalArgumentException - if node name is null

Statistic

public Statistic(String nodeName)
Creates new statistics with no values.

Parameters:
nodeName - the name of the node which correspond to this statistics row
Method Detail

setSummary

public void setSummary(boolean value)
Set the summary flag.

Parameters:
value - the new flag value

isSummary

public boolean isSummary()
Is the statistic row a special (summary) row? It will always appear at the end of the statistics dialog.

Returns:
the summary flag

getNodeName

public String getNodeName()
Returns the name of the node which correspond to this statistics row.

Returns:
the name of the node which correspond to this statistics row

setNodeName

public void setNodeName(String nodeName)
Sets the name of the node which correspond to this statistics row.

Parameters:
nodeName - the name of the node which correspond to this statistics row; may not be null
Throws:
IllegalArgumentException - if node name is null

getSource

public double getSource()
Returns the value of the statistics for the source edges.

Returns:
the value of the statistics for the source edges

setSource

public void setSource(double outgoing)
Sets the value of the statistics for the source edges.

Parameters:
outgoing - the value of the statistics for the source edges

getTarget

public double getTarget()
Returns the value of the statistics for the target edges.

Returns:
the value of the statistics for the target edges

setTarget

public void setTarget(double incoming)
Sets the value of the statistics for the target edges.

Parameters:
incoming - the value of the statistics for the target edges

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object other)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()

getTargetLabel

public String getTargetLabel()
Returns the label (i.e. string representation) of the value of the statistics of the target edges.

Returns:
the label of the statistics for the target edge

getSourceLabel

public String getSourceLabel()
Returns the label (i.e. string representation) of the value of the statistics of the source edges.

Returns:
the label of the statistics for the source edge

getTotal

public double getTotal()
Returns the total value of the statistics row.

Returns:
the total value of the statistics row

getTotalLabel

public String getTotalLabel()
Returns the label of the total value of the statistics row.

Returns:
the label of the total value of the statistics row


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.