/** * @see PersistentSortedMap#firstKey() */ public Object firstKey() { read(); return ( (java.util.SortedMap) map ).firstKey(); }
public Object put(Object key, Object value) { write(); return submap.put(key, value); } public Object remove(Object key) {
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) { if ( session.getEntityMode()==EntityMode.DOM4J ) { return new PersistentMapElementHolder(session, persister, key); } else { PersistentSortedMap map = new PersistentSortedMap(session); map.setComparator(comparator); return map; } }
public PersistentCollection wrap(SessionImplementor session, Object collection) { if ( session.getEntityMode()==EntityMode.DOM4J ) { return new PersistentElementHolder( session, (Element) collection ); } else { return new PersistentSortedMap( session, (java.util.SortedMap) collection ); } }
public PersistentSortedMap(SessionImplementor session, CollectionPersister persister, Comparator comparator, Serializable disassembled, Object owner) throws HibernateException { super(session); this.comparator=comparator; beforeInitialize(persister); Serializable[] array = (Serializable[]) disassembled; for (int i=0; i<array.length; i+=2 ) map.put( persister.getIndexType().assemble( array[i], session, owner ), persister.getElementType().assemble( array[i+1], session, owner ) ); setInitialized(); }
SortedMap sm = new TreeMap(psm.comparator()); sm.putAll((Map) o); return sm;
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) { if ( session.getEntityMode()==EntityMode.DOM4J ) { return new PersistentMapElementHolder(session, persister, key); } else { PersistentSortedMap map = new PersistentSortedMap(session); map.setComparator(comparator); return map; } }
public PersistentCollection wrap(SessionImplementor session, Object collection) { if ( session.getEntityMode()==EntityMode.DOM4J ) { return new PersistentElementHolder( session, (Element) collection ); } else { return new PersistentSortedMap( session, (java.util.SortedMap) collection ); } }
SortedMap sm = new TreeMap(psm.comparator()); for (Object o : list)
/** * @see PersistentSortedMap#firstKey() */ public Object firstKey() { read(); return ( (SortedMap) map ).firstKey(); }
public Object remove(Object key) { write(); return submap.remove(key); } public void putAll(java.util.Map other) {
/** * @see PersistentSortedMap#lastKey() */ public Object lastKey() { read(); return ( (java.util.SortedMap) map ).lastKey(); }
public void clear() { write(); submap.clear(); } public java.util.Set keySet() {
/** * @see PersistentSortedMap#lastKey() */ public Object lastKey() { read(); return ( (SortedMap) map ).lastKey(); }
public Object put(Object key, Object value) { write(); return submap.put(key, value); } public Object remove(Object key) {
/** * @see PersistentSortedMap#headMap(Object) */ public SortedMap headMap(Object toKey) { read(); SortedMap m; m = ( (SortedMap) map ).headMap(toKey); return new SortedSubMap(m); }
public void clear() { write(); submap.clear(); } public Set keySet() {
/** * @see PersistentSortedMap#subMap(Object, Object) */ public java.util.SortedMap subMap(Object fromKey, Object toKey) { read(); java.util.SortedMap m = ( (java.util.SortedMap) map ).subMap(fromKey, toKey); return new SortedSubMap(m); }
public void putAll(Map other) { write(); submap.putAll(other); } public void clear() {
/** * @see PersistentSortedMap#headMap(Object) */ public java.util.SortedMap headMap(Object toKey) { read(); java.util.SortedMap m; m = ( (java.util.SortedMap) map ).headMap(toKey); return new SortedSubMap(m); }