- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
public abstract class AbstractSegment<P extends Number, V extends IOffsettable<P, V>,
U extends AbstractSegment<P, V, U>> implements IOffsettable<P, U>, Iterable<V>, Serializable {
...
protected final List<V> offsetHelper(final P dx, final P dy) {
return Lists.transform(points, new Function<V, V>() {
@Override
public V apply(final V input) {
return input.offset(dx, dy);
}
});
}
public final class FloatSegment extends AbstractSegment<Float, FloatPoint, FloatSegment> {
...
@Override
public FloatSegment offset(final Float dx, final Float dy) {
return new FloatSegment(offsetHelper(dx, dy));
}
}
wvxvw 11.04.2012 16:22 # 0
Ой, new FloatSegment() не нужен - это?
wvxvw 11.04.2012 16:27 # 0
roman-kashitsyn 11.04.2012 16:39 # 0