diff options
author | Bryce McKinlay <bryce@gcc.gnu.org> | 2000-10-29 04:44:10 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2000-10-29 04:44:10 +0000 |
commit | db50e427f61a4ddb4007635d529a2fe06324cbfa (patch) | |
tree | b1454b947f76c75a8d729f475f99c210f6f7589b /libjava | |
parent | 7d3af72b0abf82c5371aa8edb4dd7071e385fd3f (diff) | |
download | gcc-db50e427f61a4ddb4007635d529a2fe06324cbfa.zip gcc-db50e427f61a4ddb4007635d529a2fe06324cbfa.tar.gz gcc-db50e427f61a4ddb4007635d529a2fe06324cbfa.tar.bz2 |
Re-indent in preparation for diff.
From-SVN: r37114
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/java/util/BitSet.java | 240 |
1 files changed, 120 insertions, 120 deletions
diff --git a/libjava/java/util/BitSet.java b/libjava/java/util/BitSet.java index b40da61..9a12de9 100644 --- a/libjava/java/util/BitSet.java +++ b/libjava/java/util/BitSet.java @@ -4,9 +4,9 @@ This file is part of libgcj. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ package java.util; import java.io.Serializable; @@ -23,154 +23,154 @@ import java.io.Serializable; public final class BitSet implements Cloneable, Serializable { public void and (BitSet bs) - { - int max = Math.min(bits.length, bs.bits.length); - int i; - for (i = 0; i < max; ++i) - bits[i] &= bs.bits[i]; - for ( ; i < bits.length; ++i) - bits[i] = 0; - } + { + int max = Math.min (bits.length, bs.bits.length); + int i; + for (i = 0; i < max; ++i) + bits[i] &= bs.bits[i]; + for (; i < bits.length; ++i) + bits[i] = 0; + } public BitSet () - { - this (64); - } + { + this (64); + } public BitSet (int nbits) - { - if (nbits < 0) - throw new NegativeArraySizeException (); - int length = nbits / 64; - if (nbits % 64 != 0) - ++length; - bits = new long[length]; - } + { + if (nbits < 0) + throw new NegativeArraySizeException (); + int length = nbits / 64; + if (nbits % 64 != 0) + ++length; + bits = new long[length]; + } public void clear (int pos) - { - if (pos < 0) - throw new IndexOutOfBoundsException (); - int bit = pos % 64; - int offset = pos / 64; - ensure (offset); - bits[offset] &= ~ (1L << bit); - } + { + if (pos < 0) + throw new IndexOutOfBoundsException (); + int bit = pos % 64; + int offset = pos / 64; + ensure (offset); + bits[offset] &= ~(1L << bit); + } public Object clone () - { - BitSet bs = new BitSet (bits.length * 64); - System.arraycopy(bits, 0, bs.bits, 0, bits.length); - return bs; - } + { + BitSet bs = new BitSet (bits.length * 64); + System.arraycopy (bits, 0, bs.bits, 0, bits.length); + return bs; + } public boolean equals (Object obj) - { - if (! (obj instanceof BitSet)) + { + if (!(obj instanceof BitSet)) + return false; + BitSet bs = (BitSet) obj; + int max = Math.min (bits.length, bs.bits.length); + int i; + for (i = 0; i < max; ++i) + if (bits[i] != bs.bits[i]) return false; - BitSet bs = (BitSet) obj; - int max = Math.min(bits.length, bs.bits.length); - int i; - for (i = 0; i < max; ++i) - if (bits[i] != bs.bits[i]) - return false; - // If one is larger, check to make sure all extra bits are 0. - for (int j = i; j < bits.length; ++j) - if (bits[j] != 0) - return false; - for (int j = i; j < bs.bits.length; ++j) - if (bs.bits[j] != 0) - return false; - return true; - } + // If one is larger, check to make sure all extra bits are 0. + for (int j = i; j < bits.length; ++j) + if (bits[j] != 0) + return false; + for (int j = i; j < bs.bits.length; ++j) + if (bs.bits[j] != 0) + return false; + return true; + } public boolean get (int pos) - { - if (pos < 0) - throw new IndexOutOfBoundsException (); + { + if (pos < 0) + throw new IndexOutOfBoundsException (); - int bit = pos % 64; - int offset = pos / 64; + int bit = pos % 64; + int offset = pos / 64; - if (offset >= bits.length) - return false; + if (offset >= bits.length) + return false; - return (bits[offset] & (1L << bit)) == 0 ? false : true; - } + return (bits[offset] & (1L << bit)) == 0 ? false : true; + } public int hashCode () - { - long h = 1234; - for (int i = bits.length - 1; i >= 0; --i) - h ^= bits[i] * (i + 1); - return (int) ((h >> 32) ^ h); - } + { + long h = 1234; + for (int i = bits.length - 1; i >= 0; --i) + h ^= bits[i] * (i + 1); + return (int) ((h >> 32) ^ h); + } public void or (BitSet bs) - { - ensure (bs.bits.length - 1); - int i; - for (i = 0; i < bs.bits.length; ++i) - bits[i] |= bs.bits[i]; - } + { + ensure (bs.bits.length - 1); + int i; + for (i = 0; i < bs.bits.length; ++i) + bits[i] |= bs.bits[i]; + } public void set (int pos) - { - if (pos < 0) - throw new IndexOutOfBoundsException (); - int bit = pos % 64; - int offset = pos / 64; - ensure (offset); - bits[offset] |= 1L << bit; - } + { + if (pos < 0) + throw new IndexOutOfBoundsException (); + int bit = pos % 64; + int offset = pos / 64; + ensure (offset); + bits[offset] |= 1L << bit; + } public int size () - { - return bits.length * 64; - } + { + return bits.length * 64; + } public String toString () - { - StringBuffer result = new StringBuffer ("{"); - boolean first = true; - for (int i = 0; i < bits.length; ++i) - { - int bit = 1; - long word = bits[i]; - for (int j = 0; j < 64; ++j) - { - if ((word & bit) != 0) - { - if (! first) - result.append(", "); - result.append(64 * i + j); - first = false; - } - bit <<= 1; - } - } - - return result.append("}").toString(); - } + { + StringBuffer result = new StringBuffer ("{"); + boolean first = true; + for (int i = 0; i < bits.length; ++i) + { + int bit = 1; + long word = bits[i]; + for (int j = 0; j < 64; ++j) + { + if ((word & bit) != 0) + { + if (!first) + result.append (", "); + result.append (64 * i + j); + first = false; + } + bit <<= 1; + } + } + + return result.append ("}").toString (); + } public void xor (BitSet bs) - { - ensure (bs.bits.length - 1); - int i; - for (i = 0; i < bs.bits.length; ++i) - bits[i] ^= bs.bits[i]; - } + { + ensure (bs.bits.length - 1); + int i; + for (i = 0; i < bs.bits.length; ++i) + bits[i] ^= bs.bits[i]; + } // Make sure the vector is big enough. private final void ensure (int lastElt) - { - if (lastElt + 1 > bits.length) - { - long[] nd = new long[lastElt + 1]; - System.arraycopy(bits, 0, nd, 0, bits.length); - bits = nd; - } - } + { + if (lastElt + 1 > bits.length) + { + long[] nd = new long[lastElt + 1]; + System.arraycopy (bits, 0, nd, 0, bits.length); + bits = nd; + } + } // The actual bits. private long[] bits; |