Java 8 BitSet - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 BitSet class.

This code example shows how to use the following methods: and, length, set
 */ 
import java.util.BitSet; 
 
public final class And { 
    public static void main(String[] args) throws Exception {
        BitSet a = new BitSet();
        BitSet b = new BitSet();
 
        a.set(0);
        a.set(70);
        b.set(40);
        a.and(b);
        if (a.length() != 0)
            throw new RuntimeException("Incorrect length after and().");
    } 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: clear, get, set
 
	private final BitSet minutes = new BitSet(60);
 
	private final BitSet hours = new BitSet(24);
 
	private final BitSet daysOfWeek = new BitSet(7);
 
	private final BitSet daysOfMonth = new BitSet(31);
 
	private final BitSet months = new BitSet(12);
 
	private final String expression;
 
	private final TimeZone timeZone;
 
 
	/** 
	 * Construct a {@link CronSequenceGenerator} from the pattern provided, 
	 * using the default {@link TimeZone}. 
	 * @param expression a space-separated list of time fields 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: set
 
    /** {@inheritDoc} */ 
    @Override 
    public BitSet compatibleRegs(DalvInsn insn) {
        RegisterSpecList regs = insn.getRegisters();
        BitSet bits = new BitSet(3);
 
        bits.set(0, unsignedFitsInByte(regs.get(0).getReg()));
        bits.set(1, unsignedFitsInByte(regs.get(1).getReg()));
        bits.set(2, unsignedFitsInByte(regs.get(2).getReg()));
        return bits;
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public void writeTo(AnnotatedOutput out, DalvInsn insn) {
        RegisterSpecList regs = insn.getRegisters();
        write(out,
              opcodeUnit(insn, regs.get(0).getReg()),
              codeUnit(regs.get(1).getReg(), regs.get(2).getReg()));
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: get, length, nextClearBit, set
    checkLegalKey(remainder);
 
    if (remainder < 0) {
      return false; 
    } 
    if (bitSet.get((int) remainder)) {
      return false; 
    } 
    bitSet.set((int) remainder);
    int nextClearBit = bitSet.nextClearBit(0);
    if (nextClearBit >= MIN_BITS_TO_SHIFT) {
      bitSet = bitSet.get(nextClearBit,
          Math.max(nextClearBit, bitSet.length()));
      lastBaseKey += nextClearBit;
    } 
    return true; 
  } 
 
  /** 
   * Get the number of set bits 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: get, set
m_next = r;
    } 
     
    private boolean visit(int row) {
        if ( m_visited.get(row) ) {
            return true; 
        } else { 
            m_visited.set(row);
            return false; 
        } 
    } 
     
    /** 
     * @see java.util.Iterator#hasNext() 
     */ 
    public boolean hasNext() { 
        return m_next != -1;
    } 
 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 BitSet Questions & Answers:

See Code Examples for Java 8 BitSet Methods: