Code example for BitSet

Methods: clear, set

0
	 
	public final static int NUM_MSG = 20;
	private final BitSet filter;
	 
	MsgType() { 
		this.filter = new BitSet(MsgType.NUM_MSG);
		this.filter.clear();
	} 
	 
	MsgType(int index) {
		this(); 
		//if index < 0, it is MSG_NONE 
		if (index >= 0) {
			this.filter.set(index, true);	
		} 
	} 
	 
	MsgType(int start, int end) {
		this(); 
		this.filter.set(start, end, true);
	}