public void save() { // Save individual transfer upon add but not collection itself. this.index(); }
@Override public void collectionItemAdded(final Transfer transfer) { try { this.save(transfer); if(this.isLocked()) { log.debug("Skip indexing collection while loading"); } else { this.index(); } } finally { super.collectionItemAdded(transfer); } }
/** * Importer for legacy transfers. * * @param c Existing collection */ protected void load(final Collection<Transfer> c) { this.addAll(c); // Create index for imported collection this.index(); this.sort(); for(Transfer transfer : this) { this.save(transfer); } this.collectionLoaded(); }