public PersistentSortedMap<K, V> clone(boolean uninitialize) { PersistentSortedMap<K, V> map = new PersistentSortedMap<K, V>(); if (wasInitialized() && !uninitialize) map.init(getCollection(), null, isDirty()); return map; } }
public K firstKey() { if (!checkInitializedRead()) return null; return getCollection().firstKey(); }
@Override public void addListener(InitializationListener<SortedMap<K, V>> listener) { persistentSortedMap.addListener(listener); }
@Override protected PersistentCollectionSnapshot createSnapshot(Object io, boolean forReading) { PersistentCollectionSnapshotFactory factory = PersistentCollectionSnapshotFactory.newInstance(io); if (forReading || !wasInitialized()) return factory.newPersistentCollectionSnapshot(true, getDetachedState()); return factory.newPersistentCollectionSnapshot(true, getDetachedState(), isDirty(), this); }
public PersistentSortedMap(SortedMap<K, V> collection, boolean clone) { if (collection != null) init(clone ? new TreeMap<K, V>(collection) : collection, null, false); }
public Comparator<? super K> comparator() { return getCollection().comparator(); }
public static <K, V> ObservablePersistentSortedMap<K, V> observablePersistentSortedMap() { return new ObservablePersistentSortedMap<K, V>(new PersistentSortedMap<K, V>(true)); }
@Override public boolean wasInitialized() { return persistentSortedMap.wasInitialized(); }
@Override public boolean isDirty() { return persistentSortedMap.isDirty(); }
@Override public void clearDirty() { persistentSortedMap.clearDirty(); }
@Override protected PersistentCollectionSnapshot createSnapshot(Object io, boolean forReading) { PersistentCollectionSnapshotFactory factory = PersistentCollectionSnapshotFactory.newInstance(io); if (forReading || !wasInitialized()) return factory.newPersistentCollectionSnapshot(true, getDetachedState()); return factory.newPersistentCollectionSnapshot(true, getDetachedState(), isDirty(), this); }
@Override public void doInitialize() { init(new TreeMap<K, V>(), null, false); }
public Comparator<? super K> comparator() { return getCollection().comparator(); }
public static <K, V> ReadOnlyMapWrapper<K, V> readOnlyObservablePersistentSortedMap(Object bean, String name) { return new ReadOnlyMapWrapper<K, V>(bean, name, new ObservablePersistentSortedMap<K, V>(new PersistentSortedMap<K, V>(true))); }
public PersistentSortedMap<K, V> clone(boolean uninitialize) { PersistentSortedMap<K, V> map = new PersistentSortedMap<K, V>(); if (wasInitialized() && !uninitialize) map.init(getCollection(), null, isDirty()); return map; } }
public K firstKey() { if (!checkInitializedRead()) return null; return getCollection().firstKey(); }
@Override protected PersistentCollectionSnapshot createSnapshot(Object io, boolean forReading) { PersistentCollectionSnapshotFactory factory = PersistentCollectionSnapshotFactory.newInstance(io); if (forReading || !wasInitialized()) return factory.newPersistentCollectionSnapshot(true, getDetachedState()); return factory.newPersistentCollectionSnapshot(true, getDetachedState(), isDirty(), this); }
public PersistentSortedMap(SortedMap<K, V> collection, boolean clone) { if (collection != null) init(clone ? new TreeMap<K, V>(collection) : collection, null, false); }
public Comparator<? super K> comparator() { return getCollection().comparator(); }
@Override public void addListener(ChangeListener<SortedMap<K, V>> listener) { persistentSortedMap.addListener(listener); }