|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.citra.pivot.table.context.SingleColumnContext
public class SingleColumnContext
SingleColumnContext is a context that extracts member values, based
on a single column of the rows of a table model.
It uses
a Comparator
in order to compare the two extracted values. The displayed values are taken from a single column, which is specified in
the constructor, for the default locale. Other locales can use different columns, assigned with the
setColumnForLocale
method.
Field Summary | |
---|---|
protected int |
captionColumn
the default column to use for the displayed member captions |
protected Map |
columnsByLocale
a map containing column indeces vs locales |
protected Comparator |
comparator
a comparator to use for comparing two extracted member values |
protected int |
extractColumn
the column in the table model that is used to extract the member value |
protected int |
nameColumn
the column in the table model that is used to extract the member's name |
Constructor Summary | |
---|---|
SingleColumnContext(int extractColumn)
Constructs a SingleColumnContext with extractColumn as the column holding the member name, caption and extract value. |
|
SingleColumnContext(int extractColumn,
Comparator comparator)
Constructs a SingleColumnContext with extractColumn as the column holding the member name, caption and extract value. |
|
SingleColumnContext(int extractColumn,
int nameColumn)
Constructs a SingleColumnContext with extractColumn as the column holding the extract value and nameColumn the member's name and caption. |
|
SingleColumnContext(int extractColumn,
int nameColumn,
int captionColumn)
Constructs a SingleColumnContext with extractColumn as the column holding the extract value, nameColumn the member's name and captionColumn the member's caption. |
|
SingleColumnContext(int extractColumn,
int nameColumn,
int captionColumn,
Comparator comparator)
Constructs a SingleColumnContext with extractColumn as the column holding the extract value, nameColumn the member's name and captionColumn the member's caption. |
Method Summary | |
---|---|
int |
compareMemberValues(Object o1,
Object o2)
Compares two values that have been previously extracted in the extractMemberValue method. |
Object |
extractMemberValue(List row)
Extracts a member value from a row that corresponds to the underlying table model. |
String |
getCaption(Object memberValue,
List row,
Locale locale)
Determines the caption that will be displayed for the given member value and locale. |
int |
getColumnForLocale(Locale locale)
Retrieves the column that holds the member's caption for a given locale. |
String |
getDescription(Object memberValue,
List row,
Locale locale)
Determines the description that will be displayed for the given member value and locale. |
String |
getName(Object memberValue,
List row)
Determines the name that will be displayed for the given member value. |
void |
setColumnForLocale(Locale locale,
int column)
Assigns the column that holds the member's caption for a given locale. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int extractColumn
protected int nameColumn
protected int captionColumn
protected Comparator comparator
protected Map columnsByLocale
Constructor Detail |
---|
public SingleColumnContext(int extractColumn)
public SingleColumnContext(int extractColumn, int nameColumn)
public SingleColumnContext(int extractColumn, int nameColumn, int captionColumn)
public SingleColumnContext(int extractColumn, int nameColumn, int captionColumn, Comparator comparator)
public SingleColumnContext(int extractColumn, Comparator comparator)
Method Detail |
---|
public int compareMemberValues(Object o1, Object o2)
extractMemberValue
method.
compareMemberValues
in interface TableContext
o1
- the first value to compareo2
- the second value to compare
public Object extractMemberValue(List row)
extractMemberValue
in interface TableContext
row
- the row to the table model
public String getCaption(Object memberValue, List row, Locale locale)
getCaption
in interface TableContext
memberValue
- the member valuerow
- the row to the table modellocale
- the locale for which the caption is returned
public int getColumnForLocale(Locale locale)
locale
- the locale to which a column is assigned
public String getDescription(Object memberValue, List row, Locale locale)
getDescription
in interface TableContext
memberValue
- the member valuerow
- the row to the table modellocale
- the locale for which the description is returned
public String getName(Object memberValue, List row)
getName
in interface TableContext
memberValue
- the member valuerow
- the row to the table model
public void setColumnForLocale(Locale locale, int column)
locale
- the locale to which a column is assignedcolumn
- the column index
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |