Package com.cedarsoft

Examples of com.cedarsoft.StillContainedException


    //todo, really necessary???
    if ( comparator != null ) {
      Collection<T> set = new TreeSet<T>( comparator );
      set.addAll( storedObjects );
      if ( storedObjects.size() != set.size() ) {
        throw new StillContainedException( "The stored objects collections contains duplicate entries" );
      }
    }

    this.storedObjects.addAll( storedObjects );
  }
View Full Code Here


    lock.writeLock().lock();
    try {
      if ( comparator != null ) {
        for ( T storedObject : storedObjects ) {
          if ( comparator.compare( storedObject, object ) == 0 ) {
            throw new StillContainedException( object );
          }
        }
      }

      storedObjects.add( object );
View Full Code Here

  @Override
  @NotNull
  public OutputStream openOut( @NotNull @NonNls final String id ) {
    byte[] stored = serialized.get( id );
    if ( stored != null ) {
      throw new StillContainedException( id );
    }

    return new ByteArrayOutputStream() {
      @Override
      public void close() throws IOException {
View Full Code Here

  @Override
  @NotNull
  public OutputStream openOut( @NotNull @NonNls String id ) throws FileNotFoundException {
    File file = getFile( id );
    if ( file.exists() ) {
      throw new StillContainedException( id );
    }
    return new BufferedOutputStream( new FileOutputStream( file ) );
  }
View Full Code Here

  @Override
  @NotNull
  public OutputStream openOut( @NotNull @NonNls String id ) throws FileNotFoundException {
    File file = getFile( id );
    if ( file.exists() ) {
      throw new StillContainedException( id );
    }
    return new BufferedOutputStream( new FileOutputStream( file ) );
  }
View Full Code Here

  @Override
  @NotNull
  public OutputStream openOut( @NotNull @NonNls final String id ) {
    byte[] stored = serialized.get( id );
    if ( stored != null ) {
      throw new StillContainedException( id );
    }

    return new ByteArrayOutputStream() {
      @Override
      public void close() throws IOException {
View Full Code Here

    if ( comparator != null ) {
      Collection<T> set = new TreeSet<T>( comparator );
      set.addAll( storedObjects );
      if ( storedObjects.size() != set.size() ) {
        throw new StillContainedException( "The stored objects collections contains duplicate entries" );
      }
    }

    this.storedObjects.addAll( storedObjects );
  }
View Full Code Here

    lock.writeLock().lock();
    try {
      if ( comparator != null ) {
        for ( T storedObject : storedObjects ) {
          if ( comparator.compare( storedObject, object ) == 0 ) {
            throw new StillContainedException( object );
          }
        }
      }

      storedObjects.add( object );
View Full Code Here

    //todo, really necessary???
    if ( comparator != null ) {
      Collection<T> set = new TreeSet<T>( comparator );
      set.addAll( storedObjects );
      if ( storedObjects.size() != set.size() ) {
        throw new StillContainedException( "The stored objects collections contains duplicate entries" );
      }
    }

    this.storedObjects.addAll( storedObjects );
  }
View Full Code Here

    lock.writeLock().lock();
    try {
      if ( comparator != null ) {
        for ( T storedObject : storedObjects ) {
          if ( comparator.compare( storedObject, object ) == 0 ) {
            throw new StillContainedException( object );
          }
        }
      }

      storedObjects.add( object );
View Full Code Here

TOP

Related Classes of com.cedarsoft.StillContainedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.