Here you can find the source of isEmptySet(BitSet setToTest)
Parameter | Description |
---|---|
setToTest | the set we're testing to see if it's empty |
Parameter | Description |
---|---|
NullPointerException | if the given set to test is null |
public static boolean isEmptySet(BitSet setToTest) throws NullPointerException
//package com.java2s; /*//w w w . j av a2 s .c o m * Copyright (c) 2010 The Jackson Laboratory * * This is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software. If not, see <http://www.gnu.org/licenses/>. */ import java.util.BitSet; public class Main { /** * A bit set that's empty */ private static final BitSet EMPTY_BIT_SET = new BitSet(0); /** * Test if the given set is empty * @param setToTest * the set we're testing to see if it's empty * @return * true iff its empty * @throws NullPointerException * if the given set to test is null */ public static boolean isEmptySet(BitSet setToTest) throws NullPointerException { return setToTest.equals(EMPTY_BIT_SET); } }