io.sirix.index.redblacktree.ImmutableRBNodeImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sirix-core Show documentation
Show all versions of sirix-core Show documentation
SirixDB is a hybrid on-disk and in-memory document oriented, versioned database system. It has a lightweight buffer manager, stores everything in a huge persistent and durable tree and allows efficient reconstruction of every revision. Furthermore, SirixDB implements change tracking, diffing and supports time travel queries.
package io.sirix.index.redblacktree;
import io.sirix.index.redblacktree.interfaces.ImmutableRBNodeKey;
import io.sirix.node.AbstractForwardingNode;
import io.sirix.node.NodeKind;
import io.sirix.node.delegates.NodeDelegate;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Immutable RBNode.
*
* @author Johannes Lichtenberger
*
* @param key which has to be comparable (implement Comparable interface)
*/
public final class ImmutableRBNodeImpl> extends AbstractForwardingNode
implements ImmutableRBNodeKey {
/** {@link RBNodeKey} to wrap. */
private final RBNodeKey node;
/**
* Constructor.
*
* @param node {@link RBNodeKey} to wrap.
*/
public ImmutableRBNodeImpl(final RBNodeKey node) {
assert node != null;
this.node = node;
}
@Override
public NodeKind getKind() {
return node.getKind();
}
@Override
public K getKey() {
return node.getKey();
}
@Override
public long getValueNodeKey() {
return node.getValueNodeKey();
}
@Override
public boolean isChanged() {
return node.isChanged();
}
@Override
public boolean hasLeftChild() {
return node.hasLeftChild();
}
@Override
public boolean hasRightChild() {
return node.hasRightChild();
}
@Override
public long getLeftChildKey() {
return node.getLeftChildKey();
}
@Override
public long getRightChildKey() {
return node.getRightChildKey();
}
@Override
protected @NonNull NodeDelegate delegate() {
return node.delegate();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy