Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tzaeschke committed Jun 22, 2024
1 parent 92af254 commit 6dcff2b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 49 deletions.
12 changes: 6 additions & 6 deletions src/main/java/ch/ethz/globis/phtree/util/Refs.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public static <T> T[] arrayCreate(int size) {
* @return Same array or expanded array.
* @param <T> array type
*/
@Deprecated
// TODO remove? was @Deprecated
public static <T> T[] arrayEnsureSize(T[] oldA, int requiredSize) {
if (isCapacitySufficient(oldA, requiredSize)) {
return oldA;
Expand Down Expand Up @@ -178,8 +178,8 @@ public static <T> T[] arrayClone(T[] oldA) {
private static <T> boolean isCapacitySufficient(T[] a, int requiredSize) {
return a.length >= requiredSize;
}
@Deprecated

// TODO remove? was @Deprecated
@SuppressWarnings("unchecked")
public static <T> T[] arrayTrim(T[] oldA, int requiredSize) {
int reqSize = calcArraySize(requiredSize);
Expand All @@ -192,7 +192,7 @@ public static <T> T[] arrayTrim(T[] oldA, int requiredSize) {
return newA;
}

@Deprecated
// TODO remove? was @Deprecated
public static <T> void insertAtPos(T[] values, int pos, T value) {
copyRight(values, pos, values, pos+1, values.length-pos-1);
values[pos] = value;
Expand All @@ -217,8 +217,8 @@ public static <T> T[] insertSpaceAtPos(T[] values, int pos, int requiredSize) {
copyRight(values, pos, dst, pos+1, requiredSize-1-pos);
return dst;
}
@Deprecated

// TODO remove? was @Deprecated
public static <T> void removeAtPos(T[] values, int pos) {
if (pos < values.length-1) {
copyLeft(values, pos+1, values, pos, values.length-pos-1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,9 @@ private final class NodeIterator {

/**
*
* @param node
* @param dims
* @param valTemplate A null indicates that no values are to be extracted.
* @param node node
* @param lower The minimum HC-Pos that a value should have.
* @param upper
* @param minValue The minimum value that any found value should have.
* If the found value is lower, the search continues.
* @param maxValue
* @param upper The maximum HC-Pos that a value should have.
*/
void reinitAndRun(Node node, long lower, long upper) {
this.node = node;
Expand Down
48 changes: 25 additions & 23 deletions src/main/java/ch/ethz/globis/phtree/v8/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,9 @@ void removeSub(long pos, final int DIM) {

/**
* Compare two post-fixes. Takes as parameter not the position but the post-offset-bits.
* @param pob
* @param key
* @param offsPostKey offsPostKey
* @param hcPos hcPos
* @param key key
* @return true, if the post-fixes match
*/
boolean postEqualsPOB(int offsPostKey, long hcPos, long[] key) {
Expand Down Expand Up @@ -953,10 +954,12 @@ T getPostPOB(int offsPostKey, long pos, long[] key) {

/**
* Get post-fix.
* @param offsPostKey
* @param key
* @param range After the method call, this contains the postfix if the postfix matches the
* range. Otherwise it contains only part of the postfix.
* @param offsPostKey offsPostKey
* @param hcPos hcPos
* @param key key
* @param rangeMin After the method call, this contains the postfix if the postfix matches
* the range. Otherwise it contains only part of the postfix.
* @param rangeMax rangeMax
* @return NodeEntry if the postfix matches the range, otherwise null.
* @Deprecated Use next method instead.
*/
Expand Down Expand Up @@ -984,10 +987,12 @@ NodeEntry<T> getPostPOB(int offsPostKey, long hcPos, long[] key,

/**
* Get post-fix.
* @param offsPostKey
* @param key
* @param range After the method call, this contains the postfix if the postfix matches the
* @param offsPostKey offsPostKey
* @param hcPos hcPos
* @param e entry
* @param rangeMin After the method call, this contains the postfix if the postfix matches the
* range. Otherwise it contains only part of the postfix.
* @param rangeMax rangeMax
* @return NodeEntry if the postfix matches the range, otherwise null.
*/
boolean getPostPOB(int offsPostKey, long hcPos, PhEntry<T> e,
Expand Down Expand Up @@ -1041,10 +1046,15 @@ NodeEntry<T> getPostPOB_E(int offsPostKey, long hcPos, long[] key) {

/**
* Get post-fix.
* @param offsPostKey
* @param key
* @param range After the method call, this contains the postfix if the postfix matches the
* range. Otherwise it contains only part of the postfix.
* @param offsPostKey offsPostKey
* @param hcPos hcPos
* @param DIM dim
* @param valTemplate valTemplate
* @param rangeMin After the method call, this contains the postfix if the postfix matches
* the range. Otherwise it contains only part of the postfix.
* @param rangeMax rangeMax
* @param minToCheck minToCheck
* @param maxToCheck maxToCheck
* @return true, if the postfix matches the range.
*/
@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -1430,14 +1440,6 @@ int getBitPos_Infix() {
return HC_BITS;// + DIM+1 + DIM+1;
}

/**
*
* @param offs
* @param pos
* @param DIM
* @param bufSubCnt use -1 to have it calculated by this method
* @return
*/
private int offs2ValPos(int offs, long pos, int DIM) {
if (isPostHC()) {
return (int) pos;
Expand All @@ -1453,8 +1455,8 @@ private int offs2ValPos(int offs, long pos, int DIM) {

/**
*
* @param pos
* @param DIM
* @param pos position
* @param DIM dim
* @return The position (in bits) of the postfix VALUE. For LHC, the key is stored
* directly before the value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,9 @@ private final class NodeIterator {

/**
*
* @param node
* @param DIM
* @param valTemplate A null indicates that no values are to be extracted.
* @param node node
* @param lower The minimum HC-Pos that a value should have.
* @param upper
* @param minValue The minimum value that any found value should have. If the found value is
* lower, the search continues.
* @param maxValue
* @param upper The maximum HC-Pos that a value should have.
*/
void reinitAndRun(Node<T> node, long lower, long upper) {
this.node = node;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/zoodb/index/critbit/CritBit.java
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,7 @@ private void unsetBitAfterSplit(long[] keyOrigTemplate, int posBitInt) {
/**
* Full comparison on the parameter. Assigns the parameter to 'nextKey' if comparison
* fits.
* @param keyTemplate keyTemplate
* @param keyOrigTemplate keyOrigTemplate
* @return Whether we have a match or not
*/
private boolean checkMatchOrigKDFullIntoNextVal(long[] keyOrigTemplate, V value) {
Expand Down Expand Up @@ -2092,11 +2092,11 @@ private void readPostFixAndSplit(long[] postVal, int posFirstBit, long[] current
}

/**
*
* @param src Interleaved src array
* QUESTIONS: TZ: hack: I fixed the javadoc errors without checking if the javadoc is correct!
* @param srcVal Interleaved(?) src array
* @param posFirstBit First bit to be transferred
* @param stopBit Stop bit (last bit to be transferred + 1)
* @param dst Non-interleaved destination array
* @param dstVal Non-interleaved(?) destination array
*/
private void readAndSplit(long[] srcVal, int posFirstBit, long stopBit, long[] dstVal) {
long maskSrc = 0x8000000000000000L >>> (posFirstBit & 0x3F);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/zoodb/index/critbit/CritBit64.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ private static long extractPrefix(long v, int endPos) {
}

/**
*
* @param posDiff posDIff
* @param v key
* @param startPos start position
* @param prefix prefix
* @return True if the prefix matches the value or if no prefix is defined
*/
private boolean doesPrefixMatch(int posDiff, long v, long prefix) {
Expand Down

0 comments on commit 6dcff2b

Please sign in to comment.