A
Andreas Leitgeb
I wonder if there is a simple trick, idiom or standard
utility, to re-create a BitSet from a String that was
previously generated by a BitSet's .toString() method.
Such a String usually looks like: "{0, 1, 2, 3, 5, 8, 13, 21}"
I could trim the braces, then split it at the commata,
and then parse each item to int, and .set() it in a
fresh BitSet, but maybe I'm just missing something
easier.
PS: I do not want standard object-serialization, as it must
be a human read+understandable text-representation.
Other such textual representations are ok, too, if they
make parsing easier.
utility, to re-create a BitSet from a String that was
previously generated by a BitSet's .toString() method.
Such a String usually looks like: "{0, 1, 2, 3, 5, 8, 13, 21}"
I could trim the braces, then split it at the commata,
and then parse each item to int, and .set() it in a
fresh BitSet, but maybe I'm just missing something
easier.
PS: I do not want standard object-serialization, as it must
be a human read+understandable text-representation.
Other such textual representations are ok, too, if they
make parsing easier.