Merge pull request #506 from fyrz/RocksJava-Raw-Use

[RocksJava] Raw use of parametrized class
This commit is contained in:
Adam Retter 2015-02-24 20:11:42 +00:00
commit d85993998c
6 changed files with 13 additions and 11 deletions

View File

@ -14,7 +14,7 @@ package org.rocksdb;
* @see org.rocksdb.Comparator
* @see org.rocksdb.DirectComparator
*/
public abstract class AbstractComparator<T extends AbstractSlice>
public abstract class AbstractComparator<T extends AbstractSlice<?>>
extends RocksObject {
/**

View File

@ -99,7 +99,7 @@ abstract class AbstractSlice<T> extends RocksObject {
* 2) == 0 if this == other
* 3) &gt; 0 if this &gt; other
*/
public int compare(final AbstractSlice other) {
public int compare(final AbstractSlice<?> other) {
assert (other != null);
assert (isInitialized());
return compare0(nativeHandle_, other.nativeHandle_);
@ -118,7 +118,7 @@ abstract class AbstractSlice<T> extends RocksObject {
@Override
public boolean equals(final Object other) {
if (other != null && other instanceof AbstractSlice) {
return compare((AbstractSlice)other) == 0;
return compare((AbstractSlice<?>)other) == 0;
} else {
return false;
}
@ -134,7 +134,7 @@ abstract class AbstractSlice<T> extends RocksObject {
* @return true when this slice starts with the
* {@code prefix} slice
*/
public boolean startsWith(final AbstractSlice prefix) {
public boolean startsWith(final AbstractSlice<?> prefix) {
if (prefix != null) {
assert (isInitialized());
return startsWith0(nativeHandle_, prefix.nativeHandle_);

View File

@ -118,7 +118,8 @@ public class ColumnFamilyOptions extends RocksObject
}
@Override
public ColumnFamilyOptions setComparator(AbstractComparator comparator) {
public ColumnFamilyOptions setComparator(
AbstractComparator<? extends AbstractSlice<?>> comparator) {
assert (isInitialized());
setComparatorHandle(nativeHandle_, comparator.nativeHandle_);
comparator_ = comparator;
@ -705,5 +706,5 @@ public class ColumnFamilyOptions extends RocksObject
MemTableConfig memTableConfig_;
TableFormatConfig tableFormatConfig_;
AbstractComparator comparator_;
AbstractComparator<? extends AbstractSlice<?>> comparator_;
}

View File

@ -109,7 +109,7 @@ public interface ColumnFamilyOptionsInterface {
* @param comparator java instance.
* @return the instance of the current Object.
*/
Object setComparator(AbstractComparator comparator);
Object setComparator(AbstractComparator<? extends AbstractSlice<?>> comparator);
/**
* <p>Set the merge operator to be used for merging two merge operands

View File

@ -163,7 +163,8 @@ public class Options extends RocksObject
}
@Override
public Options setComparator(AbstractComparator comparator) {
public Options setComparator(
AbstractComparator<? extends AbstractSlice<?>> comparator) {
assert (isInitialized());
setComparatorHandle(nativeHandle_, comparator.nativeHandle_);
comparator_ = comparator;
@ -1253,5 +1254,5 @@ public class Options extends RocksObject
MemTableConfig memTableConfig_;
TableFormatConfig tableFormatConfig_;
RateLimiterConfig rateLimiterConfig_;
AbstractComparator comparator_;
AbstractComparator<? extends AbstractSlice<?>> comparator_;
}

View File

@ -58,8 +58,8 @@ public class WriteBatchWithIndex extends AbstractWriteBatch {
* inserting a duplicate key, in this way an iterator will never
* show two entries with the same key.
*/
public WriteBatchWithIndex(AbstractComparator fallbackIndexComparator, int reservedBytes,
boolean overwriteKey) {
public WriteBatchWithIndex(AbstractComparator<? extends AbstractSlice<?>>
fallbackIndexComparator, int reservedBytes, boolean overwriteKey) {
super();
newWriteBatchWithIndex(fallbackIndexComparator.nativeHandle_, reservedBytes, overwriteKey);
}