// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
-// This source code is licensed under the BSD-style license found in the
-// LICENSE file in the root directory of this source tree. An additional grant
-// of patent rights can be found in the PATENTS file in the same directory.
+// This source code is licensed under both the GPLv2 (found in the
+// COPYING file in the root directory) and Apache 2.0 License
+// (found in the LICENSE.Apache file in the root directory).
package org.rocksdb;
*/
public abstract class Comparator extends AbstractComparator<Slice> {
- private final long nativeHandle_;
-
public Comparator(final ComparatorOptions copt) {
- super();
- this.nativeHandle_ = createNewComparator0(copt.nativeHandle_);
+ super(copt);
+ }
+
+ @Override
+ protected long initializeNative(final long... nativeParameterHandles) {
+ return createNewComparator0(nativeParameterHandles[0]);
}
@Override
- protected final long getNativeHandle() {
- return nativeHandle_;
+ final ComparatorType getComparatorType() {
+ return ComparatorType.JAVA_COMPARATOR;
}
private native long createNewComparator0(final long comparatorOptionsHandle);