Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: LGPL 

import java.util.BitSet;

public class Main {
    /**
     * very inefficient, but Java wonderful bitset has no subset op
     * perhaps using bit iterator would be faster, I can't be bothered.
     * @param x
     * @param y
     * @return
     */
    public static boolean isSubSet(BitSet x, BitSet y) {
        y = (BitSet) y.clone();
        y.and(x);
        return y.equals(x);
    }
}