// Solve for time float time = (float)(intersectionDistance / lineLength); // If time is outside the boundaries, return null. This algorithm can // return a negative time which indicates the previous intersection. if (time > 1.0f || time < 0.0f) { return null; } // Solve the intersection and normal float ix = time * dx + start.x; float iy = time * dy + start.y; float nx = (float)((ix - cornerX) * inverseRadius); float ny = (float)((iy - cornerY) * inverseRadius); return new Intersection( ix, iy, time, nx, ny );
@Override public ArbitraryLengthPath clone() { ArbitraryLengthPath clone = (ArbitraryLengthPath)super.clone(); clone.setSubjectVar(getSubjectVar().clone()); clone.setPathExpression(getPathExpression().clone()); clone.setObjectVar(getObjectVar().clone()); if (getContextVar() != null) { clone.setContextVar(getContextVar().clone()); } return clone; } }
@Override public BinaryTupleOperator clone() { BinaryTupleOperator clone = (BinaryTupleOperator)super.clone(); clone.setLeftArg(getLeftArg().clone()); clone.setRightArg(getRightArg().clone()); return clone; } }
@Override public void meet(final Filter filter) { //First visit children, then condition (reverse of default): filter.getArg().visit(this); filter.getCondition().visit(this); } }
@Override public Filter clone() { Filter clone = (Filter)super.clone(); clone.setCondition(getCondition().clone()); return clone; } }
@Override public LeftJoin clone() { LeftJoin clone = (LeftJoin)super.clone(); if (hasCondition()) { clone.setCondition(getCondition().clone()); } return clone; } }
@Override public Projection clone() { Projection clone = (Projection)super.clone(); clone.setProjectionElemList(getProjectionElemList().clone()); return clone; }
@Override public BinaryValueOperator clone() { BinaryValueOperator clone = (BinaryValueOperator)super.clone(); clone.setLeftArg(getLeftArg().clone()); clone.setRightArg(getRightArg().clone()); return clone; } }
@Override public ZeroLengthPath clone() { ZeroLengthPath clone = (ZeroLengthPath)super.clone(); clone.setSubjectVar(getSubjectVar().clone()); clone.setObjectVar(getObjectVar().clone()); if (getContextVar() != null) { clone.setContextVar(getContextVar().clone()); } return clone; } }
@Override public boolean equals(Object other) { if (other instanceof Projection && super.equals(other)) { Projection o = (Projection)other; return projElemList.equals(o.getProjectionElemList()); } return false; }
@Override public boolean equals(Object other) { if (other instanceof Compare && super.equals(other)) { Compare o = (Compare)other; return operator.equals(o.getOperator()); } return false; }
@Override public GroupElem clone() { GroupElem clone = (GroupElem)super.clone(); clone.setOperator(getOperator().clone()); return clone; } }
@Override public If clone() { If clone = (If)super.clone(); clone.setCondition(condition.clone()); if (result != null) { clone.setResult(result.clone()); } if (alternative != null) { clone.setAlternative(alternative.clone()); } return clone; }
@Override public boolean equals(Object other) { if (other instanceof CompareAny && super.equals(other)) { CompareAny o = (CompareAny)other; return operator.equals(o.getOperator()); } return false; }
@Override public boolean equals(Object other) { if (other instanceof CompareAll && super.equals(other)) { CompareAll o = (CompareAll)other; return operator.equals(o.getOperator()); } return false; }