NodePosition(Node<T, S> node, int position) { Preconditions.checkNotNull(node); this.node = node; this.position = position; }
public T peek() { // if (isEmpty()) // throw new RuntimeException("cannot peek on empty stack"); // else return this.head.get(); }
private RectangleDouble(double x1, double y1, double x2, double y2) { Preconditions.checkArgument(x2 >= x1); Preconditions.checkArgument(y2 >= y1); this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; }
@Override public boolean equals(Object obj) { Optional<RectangleDouble> other = ObjectsHelper.asClass(obj, RectangleDouble.class); if (other.isPresent()) { return Objects.equal(x1, other.get().x1) && Objects.equal(x2, other.get().x2) && Objects.equal(y1, other.get().y1) && Objects.equal(y2, other.get().y2); } else return false; }
/** * Sets the max number of children in an R-tree node. * * @param maxChildren * max number of children in R-tree node. * @return builder */ public Builder maxChildren(int maxChildren) { this.maxChildren = of(maxChildren); return this; }
@Override public int hashCode() { return Objects.hashCode(x, y, radius); }
NonLeafFlatBuffers(Node_ node, Context<T, S> context, Func1<byte[], ? extends T> deserializer) { Preconditions.checkNotNull(node); // remove precondition because reduces performance // Preconditions.checkArgument(node.childrenLength() > 0); this.node = node; this.context = context; this.deserializer = deserializer; }
public SerializerTypedBuilder<T> method(Method method) { // TODO remove this check when kryo ready Preconditions.checkArgument(method != Method.KRYO, "kryo serialization not implemented yet"); this.method = method; return this; }
@Override public boolean equals(Object obj) { Optional<LineDouble> other = ObjectsHelper.asClass(obj, LineDouble.class); if (other.isPresent()) { return Objects.equal(x1, other.get().x1) && Objects.equal(x2, other.get().x2) && Objects.equal(y1, other.get().y1) && Objects.equal(y2, other.get().y2); } else return false; }
/** * Constructor. * * @param root * the root node of the R-tree * @param context * options for the R-tree */ private RTree(Node<T, S> root, int size, Context<T, S> context) { this(of(root), size, context); }
public ImmutableStack<T> pop() { // if (isEmpty()) // throw new RuntimeException("cannot pop on empty stack"); // else return this.tail.get(); }
@Override public int hashCode() { return Objects.hashCode(value, geometry); }
ConnectionProviderBatch(ConnectionProvider cp, int batchSize) { Preconditions.checkNotNull(cp, "cp should not be null"); this.cp = cp; this.batchSize = batchSize; }
private RectangleFloat(float x1, float y1, float x2, float y2) { Preconditions.checkArgument(x2 >= x1); Preconditions.checkArgument(y2 >= y1); this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; }
@Override public int hashCode() { return Objects.hashCode(x1, y1, x2, y2); }
public FactoryFlatBuffers(Func1<? super T, byte[]> serializer, Func1<byte[], ? extends T> deserializer) { Preconditions.checkNotNull(serializer); Preconditions.checkNotNull(deserializer); this.serializer = serializer; this.deserializer = deserializer; }
@Override public int hashCode() { return Objects.hashCode(x1, y1, x2, y2); }