M - 模型的类型;
例如PersonModel
I - I的类型;
当使用TableRowSorter这将是Integer
public abstract static class RowFilter.Entry<M,I> extends Object
Entry对象传递给RowFilter的RowFilter ,允许过滤器获取条目数据的值,从而确定条目是否应该显示。
Entry对象包含有关模型的信息以及从模型获取基础值的方法。
RowFilter , DefaultRowSorter.setRowFilter(javax.swing.RowFilter)
| Constructor and Description |
|---|
Entry()
创建一个
Entry 。
|
| Modifier and Type | Method and Description |
|---|---|
abstract I |
getIdentifier()
返回条目的标识符(在模型中)。
|
abstract M |
getModel()
返回底层模型。
|
String |
getStringValue(int index)
返回指定索引处的字符串值。
|
abstract Object |
getValue(int index)
返回指定索引处的值。
|
abstract int |
getValueCount()
返回条目中的值的数量。
|
public abstract M getModel()
public abstract int getValueCount()
public abstract Object getValue(int index)
null 。
当与表一起使用时,索引对应于模型中的列号。
index - 要获取的值的索引
IndexOutOfBoundsException - 如果索引<0或> = getValueCount
public String getStringValue(int index)
String值这种方法是优选的到的getValue如getValue(index).toString()可以返回不同的结果比getStringValue(index) 。
这个实现在检查getValue(index).toString()后调用null 。 如果需要,提供不同字符串转换的子类应该覆盖此方法。
index - 要获取的值的索引
non-null指定索引处的字符串
IndexOutOfBoundsException - 如果索引<0 ||
> = getValueCount
public abstract I getIdentifier()
Integer 。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.