Skip to content

Instantly share code, notes, and snippets.

@tado
Created July 3, 2014 14:43
Show Gist options
  • Save tado/3b2dc7050938c857252a to your computer and use it in GitHub Desktop.
Save tado/3b2dc7050938c857252a to your computer and use it in GitHub Desktop.
EneTable Class
// EneTable
// 電力データ読み込み用クラス
class EneTable {
String date; // 日付
int data[][]; // データ
// コンストラクタ(初期化関数)
// ファイルを指定して、データをパース
EneTable(String filename) {
String[] rows = loadStrings(filename);
String[] header = split(rows[0], ",");
date = header[1];
data = new int[rows.length - 1][];
for (int i = 1; i < rows.length - 1; i++) {
int[] row = int(split(rows[i], ","));
data[i - 1] = (int[]) subset(row, 1);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment