public class JacobsonBalancedParentheses extends Object implements BalancedParentheses
HollowTrieMonotoneMinimalPerfectHashFunction.| Modifier and Type | Field and Description |
|---|---|
protected BitVector |
bitVector |
static long |
MSBS_STEP_4 |
static long |
MSBS_STEP_8 |
static long |
ONES_STEP_4 |
static long |
ONES_STEP_8 |
| Constructor and Description |
|---|
JacobsonBalancedParentheses(BitVector bv) |
JacobsonBalancedParentheses(BitVector bitVector,
boolean findOpen,
boolean findClose,
boolean enclose) |
JacobsonBalancedParentheses(long[] bits,
long length) |
| Modifier and Type | Method and Description |
|---|---|
static String |
binary(long l,
boolean reverse) |
BitVector |
bitVector()
Returns the bit vector indexed by this structure.
|
static int |
countFarClose(long word,
int l) |
static int |
countFarOpen(long word,
int l) |
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).
|
static int |
findFarClose(long word,
int k) |
static int |
findFarClose2(long word,
int k) |
static int |
findFarOpen(long word,
int l,
int k) |
static int |
findNearClose(long word) |
static int |
findNearClose2(long word) |
static int |
findNearCloseAlt(long word) |
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.
|
protected final BitVector bitVector
public static final long ONES_STEP_4
public static final long MSBS_STEP_4
public static final long ONES_STEP_8
public static final long MSBS_STEP_8
public JacobsonBalancedParentheses(BitVector bv)
public JacobsonBalancedParentheses(long[] bits,
long length)
public JacobsonBalancedParentheses(BitVector bitVector, boolean findOpen, boolean findClose, boolean enclose)
public static String binary(long l, boolean reverse)
public static final int countFarOpen(long word,
int l)
public static final int findFarOpen(long word,
int l,
int k)
public static final int countFarClose(long word,
int l)
public static final int findFarClose2(long word,
int k)
public static final int findFarClose(long word,
int k)
public static final int findNearClose2(long word)
public static final int findNearClose(long word)
public static final int findNearCloseAlt(long word)
public long enclose(long pos)
BalancedParenthesesenclose in interface BalancedParenthesespos - a position in the bit vector.public long findClose(long pos)
BalancedParenthesesNote that if you do not implement this method you must
implement BalancedParentheses.findOpen(long).
findClose in interface BalancedParenthesespos - a position in the bit vector containing an open parenthesis (a one).public long findOpen(long pos)
BalancedParenthesesNote that if you do not implement this method you must
implement BalancedParentheses.findClose(long).
findOpen in interface BalancedParenthesespos - a position in the bit vector containing a closed parenthesis (a zero).public long numBits()
BalancedParenthesesnumBits in interface BalancedParenthesespublic BitVector bitVector()
BalancedParenthesesNote that you are not supposed to modify the returned vector.
bitVector in interface BalancedParentheses