/** * {@inheritDoc} */ @Override public ValueCursor<V> getValues( K key ) throws KeyNotFoundException, IOException, IllegalArgumentException { if ( !btree.isAllowDuplicates() ) { throw new IllegalArgumentException( "Duplicates are not allowed in this tree" ); } int pos = findPos( key ); if ( pos < 0 ) { ValueHolder<V> valueHolder = values[-( pos + 1 )]; return valueHolder.getCursor(); } else { throw KeyNotFoundException.INSTANCE; } }
/** * {@inheritDoc} */ @Override public ValueCursor<V> getValues( K key ) throws KeyNotFoundException, IOException, IllegalArgumentException { if ( !btree.isAllowDuplicates() ) { throw new IllegalArgumentException( "Duplicates are not allowed in this tree" ); } int pos = findPos( key ); if ( pos < 0 ) { InMemoryValueHolder<V> valueHolder = ( InMemoryValueHolder<V> ) values[-( pos + 1 )]; return valueHolder.getCursor(); } else { throw KeyNotFoundException.INSTANCE; } }
V replacedValue = null; if ( !valueExists && btree.isAllowDuplicates() ) else if ( valueExists && btree.isAllowDuplicates() ) valueHolder.add( value ); else if ( !btree.isAllowDuplicates() )
V replacedValue = null; if ( !valueExists && btree.isAllowDuplicates() ) else if ( valueExists && btree.isAllowDuplicates() ) valueHolder.add( value ); else if ( !btree.isAllowDuplicates() )
position = store( position, ( btree.isAllowDuplicates() ? 1 : 0 ), btreeHeaderPageIos );
configuration.setKeySerializer( btree.getKeySerializer() ); configuration.setValueSerializer( btree.getValueSerializer() ); configuration.setAllowDuplicates( btree.isAllowDuplicates() ); configuration.setReadTimeOut( btree.getReadTimeOut() ); configuration.setWriteBufferSize( btree.getWriteBufferSize() );