public boolean isFull() { return ((BoundedCollection) collection).isFull(); }
public boolean isFull() { return ((BoundedCollection) collection).isFull(); }
/** * Returns true if no more elements can be added to the Collection. * <p> * This method uses the {@link BoundedCollection} interface to determine the * full status. If the collection does not implement this interface then * false is returned. * <p> * The collection does not have to implement this interface directly. * If the collection has been decorated using the decorators subpackage * then these will be removed to access the BoundedCollection. * * @param coll the collection to check * @return true if the BoundedCollection is full * @throws NullPointerException if the collection is null */ public static boolean isFull(Collection coll) { if (coll == null) { throw new NullPointerException("The collection must not be null"); } if (coll instanceof BoundedCollection) { return ((BoundedCollection) coll).isFull(); } try { BoundedCollection bcoll = UnmodifiableBoundedCollection.decorateUsing(coll); return bcoll.isFull(); } catch (IllegalArgumentException ex) { return false; } }
/** * Returns true if no more elements can be added to the Collection. * <p> * This method uses the {@link BoundedCollection} interface to determine the * full status. If the collection does not implement this interface then * false is returned. * <p> * The collection does not have to implement this interface directly. * If the collection has been decorated using the decorators subpackage * then these will be removed to access the BoundedCollection. * * @param coll the collection to check * @return true if the BoundedCollection is full * @throws NullPointerException if the collection is null */ public static boolean isFull(Collection coll) { if (coll == null) { throw new NullPointerException("The collection must not be null"); } if (coll instanceof BoundedCollection) { return ((BoundedCollection) coll).isFull(); } try { BoundedCollection bcoll = UnmodifiableBoundedCollection.decorateUsing(coll); return bcoll.isFull(); } catch (IllegalArgumentException ex) { return false; } }
/** * Tests is full */ public void testIsFull() { resetFull(); assertEquals(true, ((BoundedCollection) collection).isFull()); ((BoundedFifoBuffer) collection).remove(); assertEquals(false, ((BoundedCollection) collection).isFull()); ((BoundedFifoBuffer) collection).add("jj"); assertEquals(true, ((BoundedCollection) collection).isFull()); }
/** * Tests is full */ public void testIsFull() { resetFull(); assertEquals(true, ((BoundedCollection) collection).isFull()); ((BoundedFifoBuffer) collection).remove(); assertEquals(false, ((BoundedCollection) collection).isFull()); ((BoundedFifoBuffer) collection).add("jj"); assertEquals(true, ((BoundedCollection) collection).isFull()); }
public void testMaxSize() { final Buffer bounded = BoundedBuffer.decorate(new UnboundedFifoBuffer(), 2, 500); BoundedCollection bc = (BoundedCollection) bounded; assertEquals(2, bc.maxSize()); assertEquals(false, bc.isFull()); bounded.add("A"); assertEquals(false, bc.isFull()); bounded.add("B"); assertEquals(true, bc.isFull()); bounded.remove(); assertEquals(false, bc.isFull()); try { BoundedBuffer.decorate(new UnboundedFifoBuffer(), 0); fail(); } catch (IllegalArgumentException ex) {} try { BoundedBuffer.decorate(new UnboundedFifoBuffer(), -1); fail(); } catch (IllegalArgumentException ex) {} }
public boolean isFull() { return ((BoundedCollection) collection).isFull(); }
public boolean isFull() { return ((BoundedCollection) collection).isFull(); }
public boolean isFull() { return ((BoundedCollection) collection).isFull(); }
public boolean isFull() { return ((BoundedCollection) collection).isFull(); }
public boolean isFull() { return ((BoundedCollection) collection).isFull(); }
/** * Returns true if no more elements can be added to the Collection. * <p> * This method uses the {@link BoundedCollection} interface to determine the * full status. If the collection does not implement this interface then * false is returned. * <p> * The collection does not have to implement this interface directly. * If the collection has been decorated using the decorators subpackage * then these will be removed to access the BoundedCollection. * * @param coll the collection to check * @return true if the BoundedCollection is full * @throws NullPointerException if the collection is null */ public static boolean isFull(Collection coll) { if (coll == null) { throw new NullPointerException("The collection must not be null"); } if (coll instanceof BoundedCollection) { return ((BoundedCollection) coll).isFull(); } try { BoundedCollection bcoll = UnmodifiableBoundedCollection.decorateUsing(coll); return bcoll.isFull(); } catch (IllegalArgumentException ex) { return false; } }
/** * Returns true if no more elements can be added to the Collection. * <p> * This method uses the {@link BoundedCollection} interface to determine the * full status. If the collection does not implement this interface then * false is returned. * <p> * The collection does not have to implement this interface directly. * If the collection has been decorated using the decorators subpackage * then these will be removed to access the BoundedCollection. * * @param coll the collection to check * @return true if the BoundedCollection is full * @throws NullPointerException if the collection is null */ public static boolean isFull(Collection coll) { if (coll == null) { throw new NullPointerException("The collection must not be null"); } if (coll instanceof BoundedCollection) { return ((BoundedCollection) coll).isFull(); } try { BoundedCollection bcoll = UnmodifiableBoundedCollection.decorateUsing(coll); return bcoll.isFull(); } catch (IllegalArgumentException ex) { return false; } }
/** * Returns true if no more elements can be added to the Collection. * <p> * This method uses the {@link BoundedCollection} interface to determine the * full status. If the collection does not implement this interface then * false is returned. * <p> * The collection does not have to implement this interface directly. * If the collection has been decorated using the decorators subpackage * then these will be removed to access the BoundedCollection. * * @param coll the collection to check * @return true if the BoundedCollection is full * @throws NullPointerException if the collection is null */ public static boolean isFull(Collection coll) { if (coll == null) { throw new NullPointerException("The collection must not be null"); } if (coll instanceof BoundedCollection) { return ((BoundedCollection) coll).isFull(); } try { BoundedCollection bcoll = UnmodifiableBoundedCollection.decorateUsing(coll); return bcoll.isFull(); } catch (IllegalArgumentException ex) { return false; } }
/** * Returns true if no more elements can be added to the Collection. * <p> * This method uses the {@link BoundedCollection} interface to determine the * full status. If the collection does not implement this interface then * false is returned. * <p> * The collection does not have to implement this interface directly. * If the collection has been decorated using the decorators subpackage * then these will be removed to access the BoundedCollection. * * @param coll the collection to check * @return true if the BoundedCollection is full * @throws NullPointerException if the collection is null */ public static boolean isFull(Collection coll) { if (coll == null) { throw new NullPointerException("The collection must not be null"); } if (coll instanceof BoundedCollection) { return ((BoundedCollection) coll).isFull(); } try { BoundedCollection bcoll = UnmodifiableBoundedCollection.decorateUsing(coll); return bcoll.isFull(); } catch (IllegalArgumentException ex) { return false; } }
/** * Returns true if no more elements can be added to the Collection. * <p> * This method uses the {@link BoundedCollection} interface to determine the * full status. If the collection does not implement this interface then * false is returned. * <p> * The collection does not have to implement this interface directly. * If the collection has been decorated using the decorators subpackage * then these will be removed to access the BoundedCollection. * * @param coll the collection to check * @return true if the BoundedCollection is full * @throws NullPointerException if the collection is null */ public static boolean isFull(Collection coll) { if (coll == null) { throw new NullPointerException("The collection must not be null"); } if (coll instanceof BoundedCollection) { return ((BoundedCollection) coll).isFull(); } try { BoundedCollection bcoll = UnmodifiableBoundedCollection.decorateUsing(coll); return bcoll.isFull(); } catch (IllegalArgumentException ex) { return false; } }
/** * Returns true if no more elements can be added to the Collection. * <p> * This method uses the {@link BoundedCollection} interface to determine the * full status. If the collection does not implement this interface then * false is returned. * <p> * The collection does not have to implement this interface directly. * If the collection has been decorated using the decorators subpackage * then these will be removed to access the BoundedCollection. * * @param coll the collection to check * @return true if the BoundedCollection is full * @throws NullPointerException if the collection is null */ public static boolean isFull(Collection coll) { if (coll == null) { throw new NullPointerException("The collection must not be null"); } if (coll instanceof BoundedCollection) { return ((BoundedCollection) coll).isFull(); } try { BoundedCollection bcoll = UnmodifiableBoundedCollection.decorateUsing(coll); return bcoll.isFull(); } catch (IllegalArgumentException ex) { return false; } }
/** * Returns true if no more elements can be added to the Collection. * <p> * This method uses the {@link BoundedCollection} interface to determine the * full status. If the collection does not implement this interface then * false is returned. * <p> * The collection does not have to implement this interface directly. * If the collection has been decorated using the decorators subpackage * then these will be removed to access the BoundedCollection. * * @param coll the collection to check * @return true if the BoundedCollection is full * @throws NullPointerException if the collection is null */ public static boolean isFull(Collection coll) { if (coll == null) { throw new NullPointerException("The collection must not be null"); } if (coll instanceof BoundedCollection) { return ((BoundedCollection) coll).isFull(); } try { BoundedCollection bcoll = UnmodifiableBoundedCollection.decorateUsing(coll); return bcoll.isFull(); } catch (IllegalArgumentException ex) { return false; } }