org.sirix.api.Moved 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 org.sirix.api;
import static com.google.common.base.Preconditions.checkNotNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import com.google.common.base.MoreObjects;
/**
* Determines that a {@link NodeCursor} has been moved.
*
* @author Johannes Lichtenberger
*
* @param the cursor instance
*/
public final class Moved extends Move {
/** {@link NodeCursor} implementation. */
private final T nodeCursor;
/**
* Constructor.
*
* @param nodeCursor the cursor which has been moved
*/
public Moved(final T nodeCursor) {
this.nodeCursor = checkNotNull(nodeCursor);
}
@Override
public boolean hasMoved() {
return true;
}
@Override
public T trx() {
return nodeCursor;
}
@Override
public boolean equals(final @Nullable Object object) {
if (this == object)
return true;
if (!(object instanceof Moved))
return false;
final Moved> other = (Moved>) object;
return nodeCursor.equals(other.nodeCursor);
}
@Override
public int hashCode() {
return 0x598df91c + nodeCursor.hashCode();
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this).add("cursor", nodeCursor).toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy