implicit object BitSetFormat extends SexpFormat[BitSet]
We only support deserialisation via im.BitSet as the general
case requires going through a proxy to convert the bitmask into
elements that can be read via CanBuildFrom. If you have your
own (possibly compressed) implementation of BitSet you will
need to provide your own format.
We encode the BigInt form as a String using emacs calc-eval
notation (radix is part of the string). See ViaBigDecimalFormat
for a longer discussion about emacs number formats.
This can potentially be used in Emacs using the following (which will parse the strings into big ints every time it is queried, so it's not particularly efficient):
(require 'calc) (defmath bitsetAnd (bitset i) (logand (lsh 1 i (+ 1 i)) bitset (+ 1 i))) (defun bitsetContains (bitset i) (not (string= "0" (calc-eval "bitsetAnd($, $$)" 'num bitset i))))
(bitsetContains "10#3" 0) ; 't (bitsetContains "10#3" 1) ; 't (bitsetContains "10#3" 2) ; nil (bitsetContains "32#10000000000000001" 0) ; t (bitsetContains "16#10000000000000001" 64) ; t (bitsetContains "16#10000000000000002" 1) ; t (bitsetContains "16#10000000000000002" 64) ; t (bitsetContains "16#10000000000000002" 0) ; nil
- Alphabetic
- By Inheritance
- BitSetFormat
- SexpFormat
- SexpWriter
- SexpReader
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
read(m: Sexp): BitSet
- Definition Classes
- BitSetFormat → SexpReader
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
write(bs: BitSet): Sexp
- Definition Classes
- BitSetFormat → SexpWriter