站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档

Class java.util.BitSet - JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.util.BitSet

java.lang.Object
   |
   +----java.util.BitSet

public final class BitSet
extends Object
implements Cloneable, Serializable
A set of bits. The set automatically grows as more bits are needed.


Constructor Index

 o BitSet()
Creates an empty set.
 o BitSet(int)
Creates an empty set with the specified size.

Method Index

 o and(BitSet)
Logically ANDs this bit set with the specified set of bits.
 o clear(int)
Clears a bit.
 o clone()
Clones the BitSet.
 o equals(Object)
Compares this object against the specified object.
 o get(int)
Gets a bit.
 o hashCode()
Gets the hashcode.
 o or(BitSet)
Logically ORs this bit set with the specified set of bits.
 o set(int)
Sets a bit.
 o size()
Calculates and returns the set's size in bits.
 o toString()
Converts the BitSet to a String.
 o xor(BitSet)
Logically XORs this bit set with the specified set of bits.

Constructors

 o BitSet
 public BitSet()
Creates an empty set.

 o BitSet
 public BitSet(int nbits)
Creates an empty set with the specified size.

Parameters:
nbits - the size of the set

Methods

 o set
 public void set(int bit)
Sets a bit.

Parameters:
bit - the bit to be set
 o clear
 public void clear(int bit)
Clears a bit.

Parameters:
bit - the bit to be cleared
 o get
 public boolean get(int bit)
Gets a bit.

Parameters:
bit - the bit to be gotten
 o and
 public void and(BitSet set)
Logically ANDs this bit set with the specified set of bits.

Parameters:
set - the bit set to be ANDed with
 o or
 public void or(BitSet set)
Logically ORs this bit set with the specified set of bits.

Parameters:
set - the bit set to be ORed with
 o xor
 public void xor(BitSet set)
Logically XORs this bit set with the specified set of bits.

Parameters:
set - the bit set to be XORed with
 o hashCode
 public int hashCode()
Gets the hashcode.

Overrides:
hashCode in class Object
 o size
 public int size()
Calculates and returns the set's size in bits. The maximum element in the set is the size - 1st element.

 o equals
 public boolean equals(Object obj)
Compares this object against the specified object.

Parameters:
obj - the object to compare with
Returns:
true if the objects are the same; false otherwise.
Overrides:
equals in class Object
 o clone
 public Object clone()
Clones the BitSet.

Overrides:
clone in class Object
 o toString
 public String toString()
Converts the BitSet to a String.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Submit a bug or feature - Version 1.1.8 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1995-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.