Implemented putting excel entries

This commit is contained in:
Collin Smith
2020-12-12 16:47:45 -08:00
parent db1b60fb7d
commit e8a8de6888

View File

@ -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() {