public static void main(String[] args) { new File(FILE).delete(); ObjectContainer oc = Db4o.openFile(FILE); for (int i = 0; i < COUNT; i++) { oc.store(new AddJustOneObject()); } oc.close(); oc = Db4o.openFile(FILE); long start = System.currentTimeMillis(); oc.store(new AddJustOneObject()); oc.commit(); long stop = System.currentTimeMillis(); oc.close(); long duration = stop - start; System.out.println("Add one to " + COUNT + " and commit: " + duration + "ms"); }
/** * Method gets the size of this container. * * @return The size. */ public int getPanelsSize() { return objects.getSize(); }
/** * Method for getting the index of a given Panel * * @param object The object to get the index of * @return The index of the given object */ public int getIndex(GPropertiesPanel object) { return objects.getIndex(object); }
/** * Method for getting a Panel by index reference * * @param index The index of the object * @return The object with the given index */ public GPropertiesPanel getPanel(int index) { return (GPropertiesPanel) objects.get(index); }
/** Method for removing all current Panels */ public void removeAllPanels() { pane.removeAll(); objects.removeAll(); }
/** * Method for removing a Panel by object reference * * @param object The object to remove */ public void removePanel(GPropertiesPanel object) { pane.remove(object); objects.remove(object); }
/** * Method for removing a Panel by index reference * * @param index The index of the object to remove */ public void removePanel(int index) { pane.remove((GPropertiesPanel) objects.get(index)); objects.remove(index); }
/** * Method for adding a new Panel * * @param object The new Panel */ public void addPanel(GPropertiesPanel object, String title) { pane.add(object, title); objects.add(object); }