Java examples for java.util:BitSet
Returns true if the first parameter bitset is a subset of the second parameter bitset.
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { int subbitset = 2; int bitset = 2; System.out.println(subset(subbitset, bitset)); }/*from w w w. j ava 2 s . com*/ /** * Returns <code>true</code> if the first parameter bitset is a subset of * the second parameter bitset. * * @param subbitset * @param bitset * @return */ public static boolean subset(int subbitset, int bitset) { return (bitset & subbitset) == subbitset; } }