|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.sux4j.bits.TrivialBalancedParentheses
public class TrivialBalancedParentheses
Constructor Summary | |
---|---|
TrivialBalancedParentheses(BitVector v)
|
Method Summary | |
---|---|
BitVector |
bitVector()
Returns the bit vector indexed by this structure. |
long |
enclose(long pos)
Returns the position of the open parenthesis of the pair the most tightly encloses the given position (optional operation). |
long |
findClose(long pos)
Returns the position of the matching closed parenthesis (optional operation). |
long |
findOpen(long pos)
Returns the position of the matching open parenthesis (optional operation). |
long |
numBits()
Returns the overall number of bits allocated by this structure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TrivialBalancedParentheses(BitVector v)
Method Detail |
---|
public BitVector bitVector()
BalancedParentheses
Note that you are not supposed to modify the returned vector.
bitVector
in interface BalancedParentheses
public long enclose(long pos)
BalancedParentheses
enclose
in interface BalancedParentheses
pos
- a position in the bit vector.
public long findClose(long pos)
BalancedParentheses
Note that if you do not implement this method you must
implement BalancedParentheses.findOpen(long)
.
findClose
in interface BalancedParentheses
pos
- a position in the bit vector containing an open parenthesis (a one).
public long findOpen(long pos)
BalancedParentheses
Note that if you do not implement this method you must
implement BalancedParentheses.findClose(long)
.
findOpen
in interface BalancedParentheses
pos
- a position in the bit vector containing a closed parenthesis (a zero).
public long numBits()
BalancedParentheses
numBits
in interface BalancedParentheses
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |