mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-06 00:08:19 +07:00
Implemented putting excel entries
This commit is contained in:
@ -558,13 +558,13 @@ public abstract class Excel<
|
|||||||
E entry
|
E entry
|
||||||
) throws IllegalAccessException {
|
) throws IllegalAccessException {
|
||||||
if (indexed) {
|
if (indexed) {
|
||||||
excel.put(i, entry);
|
excel._put(i, entry);
|
||||||
} else if (primaryKeyType == int.class) {
|
} else if (primaryKeyType == int.class) {
|
||||||
int id = primaryKey.getInt(entry);
|
int id = primaryKey.getInt(entry);
|
||||||
excel.put(id, entry);
|
excel._put(id, entry);
|
||||||
} else if (primaryKeyType == String.class) {
|
} else if (primaryKeyType == String.class) {
|
||||||
String id = (String) primaryKey.get(entry);
|
String id = (String) primaryKey.get(entry);
|
||||||
excel.put(i, entry);
|
excel._put(i, entry);
|
||||||
|
|
||||||
if (excel.stringToIndex == EMPTY_OBJECT_INT_MAP) excel.stringToIndex = new ObjectIntMap<>();
|
if (excel.stringToIndex == EMPTY_OBJECT_INT_MAP) excel.stringToIndex = new ObjectIntMap<>();
|
||||||
if (!excel.stringToIndex.containsKey(id)) excel.stringToIndex.put(id, i);
|
if (!excel.stringToIndex.containsKey(id)) excel.stringToIndex.put(id, i);
|
||||||
@ -599,6 +599,11 @@ public abstract class Excel<
|
|||||||
return entryClass;
|
return entryClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final void _put(int id, E value) {
|
||||||
|
entries.put(id, value);
|
||||||
|
put(id, value);
|
||||||
|
}
|
||||||
|
|
||||||
protected void put(int id, E value) {}
|
protected void put(int id, E value) {}
|
||||||
|
|
||||||
protected int offset() {
|
protected int offset() {
|
||||||
|
Reference in New Issue
Block a user