Code example for BitSet

Methods: set

    /** {@inheritDoc} */ 
    public BitSet compatibleRegs(DalvInsn insn) {
        RegisterSpecList regs = insn.getRegisters();
        BitSet bits = new BitSet(2);
        bits.set(0, unsignedFitsInNibble(regs.get(0).getReg()));
        bits.set(1, unsignedFitsInNibble(regs.get(1).getReg()));
        return bits;
    /** {@inheritDoc} */ 
    public boolean branchFits(TargetInsn insn) {
        int offset = insn.getTargetOffset();
        // Note: A zero offset would fit, but it is prohibited by the spec. 
        return (offset != 0) && signedFitsInShort(offset);
Stop searching for code, let great code find you!  Add Codota to your java IDE