@Test public void testCopy() { IHalfLine original = HalfLine.fromDirection(Vector2.fromXY(0, 0), Vector2.fromXY(1, 1)); IHalfLine copy = original.copy(); assertThat(original.supportVector(), is(copy.supportVector())); assertThat(original.supportVector() == copy.supportVector(), is(false)); assertThat(original.directionVector(), is(copy.directionVector())); assertThat(original.directionVector() == copy.directionVector(), is(false)); }
@Override public IHalfLine copy() { IVector2 supportVector = supportVector().copy(); IVector2 directionVector = directionVector().copy(); return new HalfLine(supportVector, directionVector); }
HalfLine extends AUnboundedLine implements IHalfLine { @Override public IHalfLine copy() { IVector2 supportVector = supportVector().copy(); IVector2 directionVector = directionVector().copy(); return new HalfLine(supportVector, directionVector); } }
HalfLine extends AUnboundedLine implements IHalfLine { @Override public IHalfLine copy() { IVector2 supportVector = supportVector().copy(); IVector2 directionVector = directionVector().copy(); return new HalfLine(supportVector, directionVector); } private  HalfLine(final IVector2 supportVector, final IVector2 directionVector); }
HalfLine extends AUnboundedLine implements IHalfLine { @Override public IHalfLine copy() { IVector2 supportVector = supportVector().copy(); IVector2 directionVector = directionVector().copy(); return new HalfLine(supportVector, directionVector); } private  HalfLine(final IVector2 supportVector, final IVector2 directionVector); static IHalfLine fromDirection(final IVector2 supportVector, final IVector2 directionVector); @Override boolean equals(final Object other); @Override int hashCode(); @Override IVector2 closestPointOnLine(final IVector2 point); @Override ILine toLine(); @Override IHalfLine copy(); @Override Optional<IVector2> intersectLine(final ILine line); @Override Optional<IVector2> intersectHalfLine(final IHalfLine other); @Override Optional<IVector2> intersectSegment(final ILineSegment segment); @Override boolean isPointInFront(final IVector2 point); @Override String toString(); }
HalfLine extends AUnboundedLine implements IHalfLine { @Override public IHalfLine copy() { IVector2 supportVector = supportVector().copy(); IVector2 directionVector = directionVector().copy(); return new HalfLine(supportVector, directionVector); } private  HalfLine(final IVector2 supportVector, final IVector2 directionVector); static IHalfLine fromDirection(final IVector2 supportVector, final IVector2 directionVector); @Override boolean equals(final Object other); @Override int hashCode(); @Override IVector2 closestPointOnLine(final IVector2 point); @Override ILine toLine(); @Override IHalfLine copy(); @Override Optional<IVector2> intersectLine(final ILine line); @Override Optional<IVector2> intersectHalfLine(final IHalfLine other); @Override Optional<IVector2> intersectSegment(final ILineSegment segment); @Override boolean isPointInFront(final IVector2 point); @Override String toString();  }