/[classpath]/classpath/java/util/BitSet.java
ViewVC logotype

Diff of /classpath/java/util/BitSet.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by mark, Tue Jan 22 22:27:01 2002 UTC revision 1.12 by mark, Mon Apr 1 19:57:33 2002 UTC
# Line 102  public class BitSet implements Cloneable Line 102  public class BitSet implements Cloneable
102     */     */
103    public BitSet(int nbits)    public BitSet(int nbits)
104    {    {
105        if (nbits < 0)
106          throw new NegativeArraySizeException();
107        
108      int length = nbits >>> 6;      int length = nbits >>> 6;
109      if ((nbits & LONG_MASK) != 0)      if ((nbits & LONG_MASK) != 0)
110        ++length;        ++length;
# Line 195  public class BitSet implements Cloneable Line 198  public class BitSet implements Cloneable
198     */     */
199    public void clear(int pos)    public void clear(int pos)
200    {    {
201      int offset = pos >>> 6;      int offset = pos >> 6;
202      ensure(offset);      ensure(offset);
203      // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,      // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
204      // so we'll just let that be our exception.      // so we'll just let that be our exception.
# Line 289  public class BitSet implements Cloneable Line 292  public class BitSet implements Cloneable
292     */     */
293    public void flip(int index)    public void flip(int index)
294    {    {
295      int offset = index >>> 6;      int offset = index >> 6;
296      ensure(offset);      ensure(offset);
297      // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,      // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
298      // so we'll just let that be our exception.      // so we'll just let that be our exception.
# Line 335  public class BitSet implements Cloneable Line 338  public class BitSet implements Cloneable
338     */     */
339    public boolean get(int pos)    public boolean get(int pos)
340    {    {
341      int offset = pos >>> 6;      int offset = pos >> 6;
342      if (offset >= bits.length)      if (offset >= bits.length)
343        return false;        return false;
344      // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,      // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
# Line 498  public class BitSet implements Cloneable Line 501  public class BitSet implements Cloneable
501     */     */
502    public int nextClearBit(int from)    public int nextClearBit(int from)
503    {    {
504      int offset = from >>> 6;      int offset = from >> 6;
505      long mask = 1L << from;      long mask = 1L << from;
506      while (offset < bits.length)      while (offset < bits.length)
507        {        {
# Line 535  public class BitSet implements Cloneable Line 538  public class BitSet implements Cloneable
538     */     */
539    public int nextSetBit(int from)    public int nextSetBit(int from)
540    {    {
541      int offset = from >>> 6;      int offset = from >> 6;
542      long mask = 1L << from;      long mask = 1L << from;
543      while (offset < bits.length)      while (offset < bits.length)
544        {        {
# Line 583  public class BitSet implements Cloneable Line 586  public class BitSet implements Cloneable
586     */     */
587    public void set(int pos)    public void set(int pos)
588    {    {
589      int offset = pos >>> 6;      int offset = pos >> 6;
590      ensure(offset);      ensure(offset);
591      // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,      // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
592      // so we'll just let that be our exception.      // so we'll just let that be our exception.

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26