|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.passage.AbstractPassage
org.crosswire.jsword.passage.BitwisePassage
public class BitwisePassage
A Passage that is implemented using a BitSet - one for each verse. The attributes of the style are:
The BitSet has one more bit than the number of verses in the Bible. This would waste 1 bit per BitSet but since this doesn't cause BitSet to need an extra long it doesn't, and it saves us some maths.
for license details.
The copyright to this program is held by it's authors.
,
Serialized FormNested Class Summary | |
---|---|
private class |
BitwisePassage.VerseIterator
Iterate over the Verses |
Nested classes/interfaces inherited from class org.crosswire.jsword.passage.AbstractPassage |
---|
AbstractPassage.VerseRangeIterator |
Field Summary | |
---|---|
(package private) static long |
serialVersionUID
To make serialization work across new versions |
protected BitSet |
store
The place the real data is stored |
Fields inherited from class org.crosswire.jsword.passage.AbstractPassage |
---|
BITWISE, DISTINCT, listeners, METHOD_COUNT, originalName, RANGED, REF_ALLOWED_DELIMS, REF_OSIS_DELIM, REF_PREF_DELIM, skipNormalization, suppressEvents |
Constructor Summary | |
---|---|
protected |
BitwisePassage()
Create an empty BitwisePassage. |
protected |
BitwisePassage(String refs)
Create a Verse from a human readable string. |
Method Summary | |
---|---|
void |
add(VerseBase obj)
Add this Verse/VerseRange to this Passage |
void |
addAll(Key key)
Adds the specified element to this set if it is not already present. |
void |
blur(int verses,
RestrictionType restrict)
Widen the range of the verses/keys in this list. |
void |
clear()
Removes all of the elements from this set (optional operation). |
Object |
clone()
Get a copy of ourselves. |
boolean |
contains(VerseBase obj)
Returns true if this collection contains all the specified Verse |
int |
countVerses()
Returns the number of verses in this collection. |
boolean |
isEmpty()
Does this Passage have 0 members |
Iterator |
iterator()
|
Iterator |
rangeIterator(RestrictionType restrict)
Like verseElements() that iterates over VerseRanges instead of Verses. |
private void |
readObject(ObjectInputStream in)
Call the support mechanism in AbstractPassage |
void |
remove(VerseBase obj)
Remove this Verse/VerseRange from this Passage |
void |
removeAll(Key key)
Removes the specified elements from this set if it is present. |
void |
retainAll(Key key)
Removes all but the specified element from this set. |
private void |
writeObject(ObjectOutputStream out)
Call the support mechanism in AbstractPassage |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
static final long serialVersionUID
protected transient BitSet store
Constructor Detail |
---|
protected BitwisePassage()
DistinctPassage().add(...);
protected BitwisePassage(String refs) throws NoSuchVerseException
DistinctPassage v2 = new BitwisePassage(v1.toString());
Then v1.equals(v2);
Theoretically, since there are many ways of representing a BitwisePassage as text
string comparision along the lines of:
v1.toString().equals(v2.toString())
could be false.
Practically since toString() is standardized this will be true however.
We don't need to worry about thread safety in a ctor since we don't exist yet.
refs
- A String containing the text of the BitwisePassage
NoSuchVerseException
- If the string is not parsableMethod Detail |
---|
public Object clone()
clone
in interface Key
clone
in class AbstractPassage
public int countVerses()
Passage
countVerses
in interface Passage
countVerses
in class AbstractPassage
Verse
public boolean isEmpty()
Key
isEmpty
in interface Key
isEmpty
in class AbstractPassage
public Iterator iterator()
public Iterator rangeIterator(RestrictionType restrict)
Passage
rangeIterator
in interface Passage
rangeIterator
in class AbstractPassage
restrict
- Do we break ranges over chapters
public boolean contains(VerseBase obj)
Passage
obj
- Verse or VerseRange that may exist in this Passage
public void add(VerseBase obj)
Passage
obj
- The Verses to be removed from this Passagepublic void remove(VerseBase obj)
Passage
obj
- The Verses to be removed from this Passagepublic void addAll(Key key)
Key
addAll
in interface Key
addAll
in class AbstractPassage
key
- element to be added to this set.public void removeAll(Key key)
Key
removeAll
in interface Key
removeAll
in class AbstractPassage
key
- object to be removed from this set, if present.public void retainAll(Key key)
Key
retainAll
in interface Key
retainAll
in class AbstractPassage
key
- object to be left in this set.public void clear()
Key
clear
in interface Key
clear
in class AbstractPassage
public void blur(int verses, RestrictionType restrict)
Key
blur
in interface Key
blur
in class AbstractPassage
verses
- The number of verses/keys to widen byrestrict
- How should we restrict the blurring?Passage
private void writeObject(ObjectOutputStream out) throws IOException
out
- The stream to write our state to
IOException
- if the read failsAbstractPassage.writeObjectSupport(ObjectOutputStream)
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
in
- The stream to read our state from
IOException
- if the read fails
ClassNotFoundException
- If the read data is incorrectAbstractPassage.readObjectSupport(ObjectInputStream)
|
Copyright ยจ 2003-2005 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |