Examples of BlockException


Examples of com.ardublock.translator.block.exception.BlockException

    String servoSpecs = ",620,2200";

    if (!( tb instanceof NumberBlock ) )
    {
      throw new BlockException(this.blockId, "the Pin# of Servo must be a number");
    }

    String pinNumber = tb.toCode();
    String servoName = "servo_pin_" + pinNumber;
View Full Code Here

Examples of com.ardublock.translator.block.exception.BlockException

  {
    String varName="";
    TranslatorBlock name = this.getRequiredTranslatorBlockAtSocket(0);
    TranslatorBlock size = this.getRequiredTranslatorBlockAtSocket(1);
    if (!(name instanceof VariableFakeBlock)) {
      throw new BlockException(blockId, uiMessageBundle.getString("ardublock.error_msg.array_var_slot"));
    }
    if (!(size instanceof NumberBlock)) {
      throw new BlockException(blockId, uiMessageBundle.getString("ardublock.error_msg.array_size_slot"));
    }
   
    varName+=name.toCode();
    int foo = Integer.parseInt(size.toCode());
    varName+="[";
View Full Code Here

Examples of com.ardublock.translator.block.exception.BlockException

      ret = ret + ")";
      return codePrefix + ret + codeSuffix;
    }
    else
    {
      throw new BlockException(blockId, "must be a number");
    }
  }
View Full Code Here

Examples of com.ardublock.translator.block.exception.BlockException

      ret = ret + ") > 1000";
      return codePrefix + ret + codeSuffix;
    }
    else
    {
      throw new BlockException(blockId, "analog pin# must be a number");
    }
  }
View Full Code Here

Examples of com.hp.hpl.jena.tdb.base.block.BlockException

        if ( numFileBlocks > Integer.MAX_VALUE )
            getLog().warn(format("File size (%d) exceeds tested block number limits (%d)", filesize, blockSize)) ;

        if ( filesize%longBlockSize != 0 )
            throw new BlockException(format("File size (%d) not a multiple of blocksize (%d)", filesize, blockSize)) ;

        if ( filesize == 0 )
            isEmpty = true ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.tdb.base.block.BlockException

    final
    protected void check(long id)
    {
        if ( id > Integer.MAX_VALUE )
            throw new BlockException(format("BlockAccessBase: Id (%d) too large", id )) ;
       
        // Access to numFileBlocks not synchronized - it's only a check
        if ( id < 0 || id >= numFileBlocks )
        {
            // Do it properly!
            synchronized(this)
            {
                if ( id < 0 || id >= numFileBlocks )
                    throw new BlockException(format("BlockAccessBase: Bounds exception: %s: (%d,%d)", file.filename, id, numFileBlocks)) ;
            }
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.tdb.base.block.BlockException

    final protected void check(Block block)
    {
        check(block.getId()) ;
        ByteBuffer bb = block.getByteBuffer() ;
        if ( bb.capacity() != blockSize )
            throw new BlockException(format("BlockMgrFile: Wrong size block.  Expected=%d : actual=%d", blockSize, bb.capacity())) ;
        if ( bb.order() != SystemTDB.NetworkOrder )
            throw new BlockException("BlockMgrFile: Wrong byte order") ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.tdb.base.block.BlockException

        checkIfClosed() ;
        Block block = localBlock(id) ;
        if ( block == null )
            block = blockMgr.getReadIterator(id) ;
        if ( block == null )
            throw new BlockException("No such block: "+getLabel()+" "+id) ;
        if ( active )
            iteratorBlocks.add(block.getId()) ;
        return block ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.tdb.base.block.BlockException

    {
        if ( ! pageMgr.valid(pageId) ) {
            String msg = "RecordRangeIterator.iterator -- No such block (pageId="+pageId+", fromRec="+fromRec+", toRec="+toRec+ ")" ;
            System.err.println(msg) ;
            System.exit(0) ;
            throw new BlockException(msg) ;
        }
        return new RecordRangeIterator(pageId, fromRec, toRec, pageMgr) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.tdb.base.block.BlockException

        checkIfClosed() ;
        Block block = localBlock(id) ;
        if ( block == null )
            block = blockMgr.getReadIterator(id) ;
        if ( block == null )
            throw new BlockException("No such block: "+getLabel()+" "+id) ;
        if ( active )
            iteratorBlocks.add(block.getId()) ;
        return block ;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.