edu.cuny.cat.stat
Class CatReportVariableNameDecoder

java.lang.Object
  extended by edu.cuny.cat.stat.CatReportVariableNameDecoder
All Implemented Interfaces:
edu.cuny.stat.ReportVariableNameDecoder

public class CatReportVariableNameDecoder
extends java.lang.Object
implements edu.cuny.stat.ReportVariableNameDecoder

The class that allows to use patterns in ReportVariable names and provides the replacements for each pattern to obtain actual variable names.

Supported patterns include <trader>, <specialist>, <fee>, and <shout>, which in turn represents trader's name, specialist's name, fee names, and shout types.

Version:
$Revision: 1.5 $
Author:
Jinzhong Niu

Field Summary
protected  java.util.List<edu.cuny.stat.ReportVariableNamePattern> patterns
           
static java.lang.String[] TEMPLATES
           
 
Constructor Summary
CatReportVariableNameDecoder()
           
 
Method Summary
static CatReportVariableNameDecoder getInstance()
           
protected  java.util.regex.Pattern getPattern(java.lang.String template)
           
protected  java.lang.String[] getReplacements(java.lang.String template)
           
 java.util.List<edu.cuny.stat.ReportVariableNamePattern> patterns()
           
protected  void preparePatterns()
          prepares the patterns that this decoder supports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATES

public static java.lang.String[] TEMPLATES

patterns

protected java.util.List<edu.cuny.stat.ReportVariableNamePattern> patterns
Constructor Detail

CatReportVariableNameDecoder

public CatReportVariableNameDecoder()
Method Detail

getInstance

public static CatReportVariableNameDecoder getInstance()

patterns

public java.util.List<edu.cuny.stat.ReportVariableNamePattern> patterns()
Specified by:
patterns in interface edu.cuny.stat.ReportVariableNameDecoder

preparePatterns

protected void preparePatterns()
prepares the patterns that this decoder supports. This should be invoked after the simulation started as only until then the names of traders and specialists become available.


getPattern

protected java.util.regex.Pattern getPattern(java.lang.String template)

getReplacements

protected java.lang.String[] getReplacements(java.lang.String template)