/** * {@inheritDoc} */ public void after( E element ) throws Exception { checkNotClosed( "after()" ); if ( comparator == null ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_02011 ) ); } int comparison = comparator.compare( singleton, element ); if ( comparison > 0 ) { first(); } else { afterLast(); } }
/** * {@inheritDoc} */ public void before( E element ) throws Exception { checkNotClosed( "before()" ); if ( comparator == null ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_02010 ) ); } int comparison = comparator.compare( singleton, element ); if ( comparison < 0 ) { first(); } else { beforeFirst(); } }
private BaseEntryFilteringCursor findObject(SearchingOperationContext ctx) { DN dn = ctx.getDn(); String dnName = dn.getName(); ServerEntry se = ctx.getEntry(); log.debug("findObject()::dn=" + dnName + "::entry=" + se.toString()); //1. Try cache se = m_EntryCache.get(dn.getName()); if (se != null) { return new BaseEntryFilteringCursor( new SingletonCursor<ServerEntry>(se), ctx); } // return an empty result return new BaseEntryFilteringCursor(new EmptyCursor<ServerEntry>(), ctx); }//findObject
/** * {@inheritDoc} */ public boolean isFirst() throws Exception { checkNotClosed( "()" ); return onSingleton; }
/** * {@inheritDoc} */ public Cursor<V> valueCursor( K key ) throws Exception { if ( key == null ) { return new EmptyCursor<V>(); } LinkedAvlMapNode<K, V> node = avl.find( key ); if ( node == null ) { return new EmptyCursor<V>(); } if ( node.getValue().isOrderedSet() ) { return new AvlTreeCursor<V>( node.getValue().getOrderedSet() ); } return new SingletonCursor<V>( node.getValue().getSingleton(), valComparator ); }
/** * {@inheritDoc} */ public boolean isAfterLast() throws Exception { checkNotClosed( "()" ); return afterLast; }
/** * {@inheritDoc} */ public Cursor<Tuple<K, V>> cursor( K key ) throws Exception { if ( key == null ) { return new EmptyCursor<Tuple<K,V>>(); } LinkedAvlMapNode<K, V> node = avl.find( key ); if ( node == null ) { return new EmptyCursor<Tuple<K,V>>(); } if ( node.getValue().isOrderedSet() ) { return new KeyTupleAvlCursor<K,V>( node.getValue().getOrderedSet(), key ); } return new SingletonCursor<Tuple<K,V>>( new Tuple<K,V>( key, node.getValue().getSingleton() ), keyOnlytupleComparator ); }
/** * {@inheritDoc} */ public void afterLast() throws Exception { checkNotClosed( "()" ); beforeFirst = false; afterLast = true; onSingleton = false; }
dupsCursor = new SingletonCursor<V>( wrappedTuple.getValue().getSingleton(), wrappedCursor.getValuComparator() );
/** * {@inheritDoc} */ public boolean first() throws Exception { checkNotClosed( "()" ); beforeFirst = false; onSingleton = true; afterLast = false; return true; }
dupsCursor = new SingletonCursor<V>( values.getSingleton(), wrappedCursor.getValuComparator() );
/** * {@inheritDoc} */ public boolean isLast() throws Exception { checkNotClosed( "()" ); return onSingleton; }
dupsCursor = new SingletonCursor<V>( values.getSingleton(), wrappedCursor.getValuComparator() );
/** * {@inheritDoc} */ public void beforeFirst() throws Exception { checkNotClosed( "()" ); beforeFirst = true; afterLast = false; onSingleton = false; }
dupsCursor = new SingletonCursor<V>( values.getSingleton(), wrappedCursor.getValuComparator() );
/** * {@inheritDoc} */ public boolean isBeforeFirst() throws Exception { checkNotClosed( "()" ); return beforeFirst; }
dupsCursor = new SingletonCursor<V>( values.getSingleton(), wrappedCursor.getValuComparator() );
/** * {@inheritDoc} */ public boolean last() throws Exception { checkNotClosed( "()" ); beforeFirst = false; onSingleton = true; afterLast = false; return true; }
dupsCursor = new SingletonCursor<V>( values.getSingleton(), wrappedCursor.getValuComparator() );
/** * {@inheritDoc} */ public boolean previous() throws Exception { checkNotClosed( "()" ); if ( beforeFirst ) { return false; } if ( afterLast ) { beforeFirst = false; onSingleton = true; afterLast = false; return true; } // must be on the singleton beforeFirst = true; onSingleton = false; afterLast = false; return false; }