gluu
公開メンバ関数 | 変数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.gluu.oxtrust.model.table.Table クラス
org.gluu.oxtrust.model.table.Table の継承関係図
Inheritance graph
org.gluu.oxtrust.model.table.Table 連携図
Collaboration graph

公開メンバ関数

String getCellValue (int col, int row)
 
void addCell (Cell cell)
 
int getCountCols ()
 
void setCountCols (int countCols)
 
int getCountRows ()
 
void setCountRows (int countRows)
 
String toString ()
 

変数

int countRows = -1
 

非公開変数類

HashMap< Integer, HashMap< Integer, Cell > > cells = new HashMap<Integer, HashMap<Integer, Cell>>()
 
int countCols = -1
 

静的非公開変数類

static final long serialVersionUID = 2766629412918360302L
 

詳解

Table

著者
Yuriy Movchan Date: 02.15.2010

関数詳解

◆ addCell()

void org.gluu.oxtrust.model.table.Table.addCell ( Cell  cell)
inline
38  {
39  int col = cell.getCol();
40  int row = cell.getRow();
41 
42  HashMap<Integer, Cell> rows = this.cells.get(col);
43  if (rows == null) {
44  rows = new HashMap<Integer, Cell>();
45  cells.put(col, rows);
46  }
47 
48  rows.put(row, cell);
49 
50  this.countCols = Math.max(this.countCols, col);
51  this.countRows = Math.max(this.countRows, row);
52  }
HashMap< Integer, HashMap< Integer, Cell > > cells
Definition: Table.java:21
int countRows
Definition: Table.java:22
int countCols
Definition: Table.java:22

◆ getCellValue()

String org.gluu.oxtrust.model.table.Table.getCellValue ( int  col,
int  row 
)
inline
24  {
25  HashMap<Integer, Cell> rows = cells.get(col);
26  if (rows == null) {
27  return "";
28  }
29 
30  Cell cell = rows.get(row);
31  if (cell == null) {
32  return "";
33  }
34 
35  return cell.getValue();
36  }
HashMap< Integer, HashMap< Integer, Cell > > cells
Definition: Table.java:21

◆ getCountCols()

int org.gluu.oxtrust.model.table.Table.getCountCols ( )
inline
54  {
55  return countCols;
56  }
int countCols
Definition: Table.java:22

◆ getCountRows()

int org.gluu.oxtrust.model.table.Table.getCountRows ( )
inline
62  {
63  return countRows;
64  }
int countRows
Definition: Table.java:22

◆ setCountCols()

void org.gluu.oxtrust.model.table.Table.setCountCols ( int  countCols)
inline
58  {
59  this.countCols = countCols;
60  }
int countCols
Definition: Table.java:22

◆ setCountRows()

void org.gluu.oxtrust.model.table.Table.setCountRows ( int  countRows)
inline
66  {
67  this.countRows = countRows;
68  }
int countRows
Definition: Table.java:22

◆ toString()

String org.gluu.oxtrust.model.table.Table.toString ( )
inline
71  {
72  StringBuilder sb = new StringBuilder("Table:\n");
73 
74  for (int i = 0; i < this.countCols; i++) {
75  sb.append("Column: ").append(i).append(":\t");
76  for (int j = 0; j < this.countRows; j++) {
77  sb.append(getCellValue(i, j));
78  if (j == this.countRows - 1) {
79  sb.append("\n");
80  } else {
81  sb.append(", ");
82  }
83  }
84  }
85 
86  return sb.toString();
87  }
int countRows
Definition: Table.java:22
int countCols
Definition: Table.java:22
String getCellValue(int col, int row)
Definition: Table.java:24

メンバ詳解

◆ cells

HashMap<Integer, HashMap<Integer, Cell> > org.gluu.oxtrust.model.table.Table.cells = new HashMap<Integer, HashMap<Integer, Cell>>()
private

◆ countCols

int org.gluu.oxtrust.model.table.Table.countCols = -1
private

◆ countRows

int org.gluu.oxtrust.model.table.Table.countRows = -1
package

◆ serialVersionUID

final long org.gluu.oxtrust.model.table.Table.serialVersionUID = 2766629412918360302L
staticprivate

このクラス詳解は次のファイルから抽出されました: