diff options
author | michelou <michelou@epfl.ch> | 2004-07-16 12:00:51 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2004-07-16 12:00:51 +0000 |
commit | 147b761ceaaac0265af38bf4c00f71779a4ed1ea (patch) | |
tree | 5e98fc46079f4e8368aa396b804ddaa1a6853f6c | |
parent | 395ad8ef2ac1dd56100a5fce1d9bdce74ecc485a (diff) | |
download | scala-147b761ceaaac0265af38bf4c00f71779a4ed1ea.tar.gz scala-147b761ceaaac0265af38bf4c00f71779a4ed1ea.tar.bz2 scala-147b761ceaaac0265af38bf4c00f71779a4ed1ea.zip |
- updated some comments.
-rw-r--r-- | sources/scala/collection/immutable/BitSet.scala | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/sources/scala/collection/immutable/BitSet.scala b/sources/scala/collection/immutable/BitSet.scala index 194cca7e60..9dde4a7ae2 100644 --- a/sources/scala/collection/immutable/BitSet.scala +++ b/sources/scala/collection/immutable/BitSet.scala @@ -7,31 +7,41 @@ ** $Id$ \* */ -package scala.collection.immutable ; +package scala.collection.immutable; -/** An immutable bitset view on a byte array. Instances can conveniently be - * created from instances of mutable.ResizableBitSet - * n: number of relevant bits - * ba: array of bytes of length n>>>3 - * copy: if yes, then ba is copied and updates will not affect this bitset +/** The class <code>BitSet</code>provides an immutable bitset view on a + * byte array. Instances can conveniently be created from instances of + * <code>mutable.ResizableBitSet</code>. + * + * @param <code>n</code> represents the number of relevant bits + * @param ba: array of bytes of length <code>n</code>>>>3 + * @param copy: if yes, then <code>ba</code> is copied and updates will + * not affect this bitset + * * @author Burak Emir + * @version 1.0 */ -class BitSet(n:Int, ba: Array[Byte], copy:Boolean) extends scala.collection.BitSet { +class BitSet(n:Int, ba: Array[Byte], copy: Boolean) extends scala.collection.BitSet { - final def size = n; + final def size = n; - val array:Array[Byte] = - if( copy ) { + val array: Array[Byte] = + if (copy) { val arr = new Array[Byte](ba.length); - java.lang.System.arraycopy( ba, 0, arr, 0, ba.length ); + java.lang.System.arraycopy(ba, 0, arr, 0, ba.length); arr - } else ba; + } + else + ba; def this(rbs: scala.collection.mutable.ResizableBitSet) = { this(rbs.size, rbs.toByteArray, false); } - /** returns true if bit i is set */ + /** returns true if bit i is set + * + * @param i + */ def apply(i: Int):Boolean = { val j = (i >>> 3); val mask = (1 << (i & 0x07)); |