📄 indexrecord.java
字号:
package org.geotools.data.shapefile.indexed.attribute;
/**
* Record stored in attribute index file
*
* @author Manuele Ventoruzzo
*/
public class IndexRecord implements Comparable {
private Comparable attribute;
private long featureID;
public IndexRecord(Comparable attribute, long featureID) {
this.attribute = attribute;
this.featureID = featureID;
}
public Object getAttribute() {
return attribute;
}
public long getFeatureID() {
return featureID;
}
public int compareTo(Object o) {
if (o instanceof IndexRecord) {
return attribute.compareTo(((IndexRecord) o).getAttribute());
}
if (attribute.getClass().isInstance(o)) {
// compare just attribute with o
return attribute.compareTo(o);
}
throw new ClassCastException("Object " + o.toString() + " is not of Record type");
}
public String toString() {
return "(" + attribute.toString() + "," + featureID + ")";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -