|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjp.sf.orangesignal.trading.stats.report.TextFileReporter
public class TextFileReporter
パフォーマンス情報をテキストファイルへ出力する Reporter
の実装クラスを提供します。
フィールドの概要 | |
---|---|
protected static String |
DEFAULT_BASE_PATH
テンプレートやリソースを読込むデフォルトのパスです。 |
protected static String |
DEFAULT_ENCODING
デフォルトのエンコーディングです。 |
protected static Configuration |
defaultConfig
デフォルトの FreeMarker 設定情報です。 |
protected static List<String> |
defaultResourceList
デフォルトの画像やスタイルシートなどのリソース名のリストです。 |
protected static Map<String,String> |
defaultStatsTemplateMap
デフォルトのパフォーマンス統計テンプレート名とファイル名のマップです。 |
protected static Map<String,String> |
defaultSummaryTemplateMap
デフォルトのパフォーマンス概要テンプレート名とファイル名のマップです。 |
protected String |
dir
出力ディレクトリを保持します。 |
protected Configuration |
freemarker
FreeMarker 設定情報を保持します。 |
static String |
KEY_BACKTESTER
バックテスト実行オブジェクトのキー名です。 |
static String |
KEY_LONG_STATS
買いパフォーマンス統計情報のキー名です。 |
static String |
KEY_LOSS_STATS
負けパフォーマンス統計情報のキー名です。 |
static String |
KEY_LOSS_SUMMARY
負けパフォーマンス概要情報のキー名です。 |
static String |
KEY_SHORT_STATS
売りパフォーマンス統計情報のキー名です。 |
static String |
KEY_STATS
パフォーマンス統計情報のキー名です。 |
static String |
KEY_STATS_MAP
パフォーマンス統計情報マップのキー名です。 |
static String |
KEY_SUMMARY
パフォーマンス概要情報のキー名です。 |
static String |
KEY_SYMBOL
シンボルのキー名です。 |
static String |
KEY_SYMBOL_NAME
シンボル名のキー名です。 |
static String |
KEY_TIMESTAMP
レポート作成日時のキー名です。 |
static String |
KEY_TRADE_LIST
トレード情報のリストのキー名です。 |
static String |
KEY_WIN_STATS
勝ちパフォーマンス統計情報のキー名です。 |
static String |
KEY_WIN_SUMMARY
勝ちパフォーマンス概要情報のキー名です。 |
protected static Log |
log
共通ログインスタンスです。 |
protected List<String> |
resourceList
画像やスタイルシートなどのリソース名のリストを保持します。 |
protected Map<String,String> |
statsTemplateMap
パフォーマンス統計テンプレート名とファイル名のマップを保持します。 |
protected Map<String,String> |
summaryTemplateMap
パフォーマンス概要テンプレート名とファイル名のマップを保持します。 |
コンストラクタの概要 | |
---|---|
TextFileReporter()
デフォルトコンストラクタです。 |
メソッドの概要 | |
---|---|
protected void |
copyResources()
リソースをコピーします。 |
protected static void |
marge(Template template,
Map<String,Object> model,
String filename)
指定されたテンプレートとコンテキストパラメータをマージして指定されたファイルへ保存します。 |
protected static void |
marge(Template template,
Map<String,Object> model,
String filename,
String encoding)
指定されたテンプレートとコンテキストパラメータをマージして指定されたファイルへ保存します。 |
void |
report(Stats stats)
実装は単に、 report(Stats, boolean) をリソースをコピーするとして呼出すだけです。 |
void |
report(Stats stats,
boolean copyResources)
パフォーマンス統計情報を出力します。 |
void |
report(Summary summary,
Backtester backtester)
実装は単に、 report(Summary, Backtester, boolean) をリソースをコピーするとして呼出すだけです。 |
void |
report(Summary summary,
Backtester backtester,
boolean copyResources)
パフォーマンス概要情報を出力します。 |
void |
setDir(String dir)
出力ディレクトリを設定します。 |
void |
setFreemarker(Configuration freemarker)
FreeMarker 設定情報を設定します。 |
void |
setResourceList(List<String> resourceList)
画像やスタイルシートなどのリソース名のリストを設定します。 |
void |
setStatsTemplateMap(Map<String,String> statsTemplateMap)
パフォーマンス統計テンプレート名とファイル名のマップを設定します。 |
void |
setSummaryTemplateMap(Map<String,String> summaryTemplateMap)
パフォーマンス概要テンプレート名とファイル名のマップを設定します。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
protected static final Log log
protected static final String DEFAULT_BASE_PATH
protected static final String DEFAULT_ENCODING
protected static Configuration defaultConfig
protected static final Map<String,String> defaultSummaryTemplateMap
protected static final Map<String,String> defaultStatsTemplateMap
protected static final List<String> defaultResourceList
protected Configuration freemarker
protected Map<String,String> summaryTemplateMap
protected Map<String,String> statsTemplateMap
protected List<String> resourceList
protected String dir
public static final String KEY_TIMESTAMP
public static final String KEY_BACKTESTER
public static final String KEY_SUMMARY
public static final String KEY_WIN_SUMMARY
public static final String KEY_LOSS_SUMMARY
public static final String KEY_STATS_MAP
public static final String KEY_SYMBOL
public static final String KEY_SYMBOL_NAME
public static final String KEY_STATS
public static final String KEY_LONG_STATS
public static final String KEY_SHORT_STATS
public static final String KEY_WIN_STATS
public static final String KEY_LOSS_STATS
public static final String KEY_TRADE_LIST
コンストラクタの詳細 |
---|
public TextFileReporter()
メソッドの詳細 |
---|
public void setFreemarker(Configuration freemarker)
freemarker
- FreeMarker 設定情報public void setSummaryTemplateMap(Map<String,String> summaryTemplateMap)
summaryTemplateMap
- パフォーマンス概要テンプレート名とファイル名のマップpublic void setStatsTemplateMap(Map<String,String> statsTemplateMap)
statsTemplateMap
- パフォーマンス統計テンプレート名とファイル名のマップpublic void setResourceList(List<String> resourceList)
resourceList
- 画像やスタイルシートなどのリソース名のリストpublic void setDir(String dir)
dir
- 出力ディレクトリpublic void report(Summary summary, Backtester backtester) throws IOException
report(Summary, Backtester, boolean)
をリソースをコピーするとして呼出すだけです。
Reporter
内の report
summary
- パフォーマンス概要情報backtester
- バックテスト実行オブジェクト
IOException
- 入出力操作で例外が発生した場合report(Summary, Backtester, boolean)
public void report(Summary summary, Backtester backtester, boolean copyResources) throws IOException
パフォーマンス概要情報を出力します。
実装は、FreeMarker を使用してテンプレートファイルからレポートを生成します。
テンプレート中で使用可能なオブジェクトの定義を以下に記載します。
report(Stats, boolean)
をリソースをコピーしないとして呼出します。
summary
- パフォーマンス概要情報backtester
- バックテスト実行オブジェクトcopyResources
- 画像やスタイルシートなどのリソースを出力ディレクトへコピーするかどうか
IOException
- 入出力操作で例外が発生した場合public void report(Stats stats) throws IOException
report(Stats, boolean)
をリソースをコピーするとして呼出すだけです。
Reporter
内の report
stats
- パフォーマンス統計情報
IOException
- 入出力操作で例外が発生した場合report(Stats, boolean)
public void report(Stats stats, boolean copyResources) throws IOException
パフォーマンス統計情報を出力します。
実装は、FreeMarker を使用してテンプレートファイルからレポートを生成します。
テンプレート中で使用可能なオブジェクトの定義を以下に記載します。
stats
- パフォーマンス統計情報copyResources
- 画像やスタイルシートなどのリソースを出力ディレクトへコピーするかどうか
IOException
- 入出力操作で例外が発生した場合protected void copyResources() throws IOException
IOException
- 入出力例外が発生した場合protected static void marge(Template template, Map<String,Object> model, String filename) throws IOException, TemplateException
template
- テンプレートmodel
- コンテキストパラメータfilename
- 保存するファイル
IOException
TemplateException
protected static void marge(Template template, Map<String,Object> model, String filename, String encoding) throws IOException, TemplateException
template
- テンプレートmodel
- コンテキストパラメータfilename
- 保存するファイル
IOException
TemplateException
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |