net.xqhs.graphs.matcher
Class MonitorPack

java.lang.Object
  extended by net.xqhs.graphs.matcher.MonitorPack
All Implemented Interfaces:
net.xqhs.util.logging.LoggerSimple

public class MonitorPack
extends java.lang.Object
implements net.xqhs.util.logging.LoggerSimple

The class works in conjunction with graph matching classes (such as GraphMatcherQuick) to handle both performance evaluation and visualizing tasks.

It offers various performance indicators that are easy to update.

It offers the logging methods specified by LoggerSimple.

It maintains a link with an instance of MatchingVisualizer.

Author:
Andrei Olaru

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.xqhs.util.logging.LoggerSimple
net.xqhs.util.logging.LoggerSimple.Level
 
Field Summary
(package private)  net.xqhs.util.logging.LoggerSimple log
          The log to use.
(package private)  java.util.concurrent.atomic.AtomicInteger matchCount
          Measures the total number of matches created.
(package private)  java.util.concurrent.atomic.AtomicInteger memory
          Measures the amount of memory, as declared by the caller.
(package private)  java.util.concurrent.atomic.AtomicInteger mergeCount
          Measures the total number of merges between matches.
(package private)  java.util.concurrent.atomic.AtomicInteger performanceEdges
          Measures performance of the algorithm in terms of compared edge references.
(package private)  java.util.concurrent.atomic.AtomicInteger performanceEdgesLabels
          Measures performance of the algorithm in terms of compared edge labels.
(package private)  java.util.concurrent.atomic.AtomicInteger performanceNodes
          Measures performance of the algorithm in terms of compared node references.
(package private)  java.util.concurrent.atomic.AtomicInteger performanceNodesLabels
          Measures performance of the algorithm in terms of compared node labels.
(package private)  MatchingVisualizer visual
          Matching visualizer to view the matching process.
 
Fields inherited from interface net.xqhs.util.logging.LoggerSimple
ARGUMENT_BEGIN, ARGUMENT_END, ARGUMENT_PLACEHOLDER
 
Constructor Summary
MonitorPack()
           
 
Method Summary
 void dbg(net.xqhs.util.logging.Debug.DebugItem debug, java.lang.String message, java.lang.Object... arguments)
           
 int getMatchCount()
           
 int getMemoryIndication()
           
 int getMergeCount()
           
 int getPerformanceEdges()
           
 int getPerformanceEdgesLabels()
           
 int getPerformanceNodes()
           
 int getPerformanceNodesLabels()
           
 MatchingVisualizer getVisual()
           
 int incrementEdgeLabelComparison()
          Increments the performance indicator.
 int incrementEdgeLabelComparison(int increment)
          Increments the performance indicator with the specified value.
 int incrementEdgeReferenceOperation()
          Increments the performance indicator.
 int incrementEdgeReferenceOperation(int increment)
          Increments the performance indicator with the specified value.
 int incrementMatchCount()
          Increments the performance indicator.
 int incrementMergeCount()
          Increments the performance indicator.
 int incrementNodeLabelComparison()
          Increments the performance indicator.
 int incrementNodeLabelComparison(int increment)
          Increments the performance indicator with the specified value.
 int incrementNodeReferenceOperation()
          Increments the performance indicator.
 int incrementNodeReferenceOperation(int increment)
          Increments the performance indicator with the specified value.
 void le(java.lang.String message, java.lang.Object... arguments)
           
 void lf(java.lang.String message, java.lang.Object... arguments)
           
 void li(java.lang.String message, java.lang.Object... arguments)
           
 java.lang.Object lr(java.lang.Object ret)
           
 java.lang.Object lr(java.lang.Object ret, java.lang.String message, java.lang.Object... arguments)
           
 void lw(java.lang.String message, java.lang.Object... arguments)
           
 java.lang.String printStats()
          Prints a one-line view of the performance indicators, as a log line (if any log exists).
 MonitorPack setLog(net.xqhs.util.logging.LoggerSimple logger)
          Sets the log to use by this instance.
 int setMemoryIndication(int indication)
          Sets the current memory consumption.
 MonitorPack setVisual(MatchingVisualizer visualizer)
          Sets the MatchingVisualizer instance to use to visualize the matching process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

visual

MatchingVisualizer visual
Matching visualizer to view the matching process.


log

net.xqhs.util.logging.LoggerSimple log
The log to use.


performanceNodes

java.util.concurrent.atomic.AtomicInteger performanceNodes
Measures performance of the algorithm in terms of compared node references.


performanceNodesLabels

java.util.concurrent.atomic.AtomicInteger performanceNodesLabels
Measures performance of the algorithm in terms of compared node labels.


performanceEdges

java.util.concurrent.atomic.AtomicInteger performanceEdges
Measures performance of the algorithm in terms of compared edge references.


performanceEdgesLabels

java.util.concurrent.atomic.AtomicInteger performanceEdgesLabels
Measures performance of the algorithm in terms of compared edge labels.


matchCount

java.util.concurrent.atomic.AtomicInteger matchCount
Measures the total number of matches created.


mergeCount

java.util.concurrent.atomic.AtomicInteger mergeCount
Measures the total number of merges between matches.


memory

java.util.concurrent.atomic.AtomicInteger memory
Measures the amount of memory, as declared by the caller.

Constructor Detail

MonitorPack

public MonitorPack()
Method Detail

setLog

public MonitorPack setLog(net.xqhs.util.logging.LoggerSimple logger)
Sets the log to use by this instance. All logging messages posted to this instance will be posted to the log specified in the argument.

Parameters:
logger - - an instance implementing LoggerSimple.
Returns:
the instance itself.

setVisual

public MonitorPack setVisual(MatchingVisualizer visualizer)
Sets the MatchingVisualizer instance to use to visualize the matching process.

Parameters:
visualizer - - the MatchingVisualizer object to use.
Returns:
the instance itself.

getVisual

public MatchingVisualizer getVisual()
Returns:
the MatchingVisualizer instance in use.

getPerformanceNodes

public int getPerformanceNodes()
Returns:
the performanceNodes

getPerformanceNodesLabels

public int getPerformanceNodesLabels()
Returns:
the performanceNodesLabels

getPerformanceEdges

public int getPerformanceEdges()
Returns:
the performanceEdges

getPerformanceEdgesLabels

public int getPerformanceEdgesLabels()
Returns:
the performanceEdgesLabels

getMatchCount

public int getMatchCount()
Returns:
the matchCount

getMergeCount

public int getMergeCount()
Returns:
the mergeCount

getMemoryIndication

public int getMemoryIndication()
Returns:
the memory indication.

incrementEdgeLabelComparison

public int incrementEdgeLabelComparison()
Increments the performance indicator.

Returns:
the current (updated) value.

incrementEdgeLabelComparison

public int incrementEdgeLabelComparison(int increment)
Increments the performance indicator with the specified value.

Parameters:
increment - the increment.
Returns:
the current (updated) value.

incrementEdgeReferenceOperation

public int incrementEdgeReferenceOperation()
Increments the performance indicator.

Returns:
the current (updated) value.

incrementEdgeReferenceOperation

public int incrementEdgeReferenceOperation(int increment)
Increments the performance indicator with the specified value.

Parameters:
increment - the increment.
Returns:
the current (updated) value.

incrementNodeLabelComparison

public int incrementNodeLabelComparison()
Increments the performance indicator.

Returns:
the current (updated) value.

incrementNodeLabelComparison

public int incrementNodeLabelComparison(int increment)
Increments the performance indicator with the specified value.

Parameters:
increment - the increment.
Returns:
the current (updated) value.

incrementNodeReferenceOperation

public int incrementNodeReferenceOperation()
Increments the performance indicator.

Returns:
the current (updated) value.

incrementNodeReferenceOperation

public int incrementNodeReferenceOperation(int increment)
Increments the performance indicator with the specified value.

Parameters:
increment - the increment.
Returns:
the current (updated) value.

incrementMatchCount

public int incrementMatchCount()
Increments the performance indicator.

Returns:
the current (updated) value.

incrementMergeCount

public int incrementMergeCount()
Increments the performance indicator.

Returns:
the current (updated) value.

setMemoryIndication

public int setMemoryIndication(int indication)
Sets the current memory consumption.

Parameters:
indication - - the indication on the memory consumption.
Returns:
the previously stored indication.

printStats

public java.lang.String printStats()
Prints a one-line view of the performance indicators, as a log line (if any log exists).

Returns:
the same string that was printed.

le

public void le(java.lang.String message,
               java.lang.Object... arguments)
Specified by:
le in interface net.xqhs.util.logging.LoggerSimple

lw

public void lw(java.lang.String message,
               java.lang.Object... arguments)
Specified by:
lw in interface net.xqhs.util.logging.LoggerSimple

li

public void li(java.lang.String message,
               java.lang.Object... arguments)
Specified by:
li in interface net.xqhs.util.logging.LoggerSimple

lf

public void lf(java.lang.String message,
               java.lang.Object... arguments)
Specified by:
lf in interface net.xqhs.util.logging.LoggerSimple

lr

public java.lang.Object lr(java.lang.Object ret)
Specified by:
lr in interface net.xqhs.util.logging.LoggerSimple

lr

public java.lang.Object lr(java.lang.Object ret,
                           java.lang.String message,
                           java.lang.Object... arguments)
Specified by:
lr in interface net.xqhs.util.logging.LoggerSimple

dbg

public void dbg(net.xqhs.util.logging.Debug.DebugItem debug,
                java.lang.String message,
                java.lang.Object... arguments)
Specified by:
dbg in interface net.xqhs.util.logging.LoggerSimple