File tree 6 files changed +7
-28
lines changed
6 files changed +7
-28
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,7 @@ public double distance(final Point2d coord) {
75
75
/** {@inheritDoc} */
76
76
@ Override
77
77
public boolean equals (final Object obj ) {
78
- if (obj instanceof Point2d ) {
79
- return this .vector .equals (toV2D ((Point2d ) obj ));
80
- }
81
- return false ;
78
+ return obj instanceof Point2d && this .vector .equals (toV2D ((Point2d ) obj ));
82
79
}
83
80
84
81
/** {@inheritDoc} */
Original file line number Diff line number Diff line change @@ -57,28 +57,25 @@ public double getLenght() {
57
57
/** {@inheritDoc} */
58
58
@ Override
59
59
public Vector2d normalize () {
60
- return toVector (this .vector .normalize ());
60
+ return toV2d (this .vector .normalize ());
61
61
}
62
62
63
63
/** {@inheritDoc} */
64
64
@ Override
65
65
public Vector2d negate () {
66
- return toVector (this .vector .negate ());
66
+ return toV2d (this .vector .negate ());
67
67
}
68
68
69
69
/** {@inheritDoc} */
70
70
@ Override
71
71
public Vector2d scalarMultiply (final double a ) {
72
- return toVector (this .vector .scalarMultiply (a ));
72
+ return toV2d (this .vector .scalarMultiply (a ));
73
73
}
74
74
75
75
/** {@inheritDoc} */
76
76
@ Override
77
77
public boolean equals (final Object obj ) {
78
- if (obj instanceof Vector2d ) {
79
- return this .vector .equals (toV2D ((Vector2d ) obj ));
80
- }
81
- return false ;
78
+ return obj instanceof Vector2d && this .vector .equals (toV2D ((Vector2d ) obj ));
82
79
}
83
80
84
81
/** {@inheritDoc} */
@@ -99,7 +96,7 @@ public Point2d toP2d() {
99
96
return new Point2dImpl (getX (), getY ());
100
97
}
101
98
102
- private Vector2d toVector (final Vector2D v ) {
99
+ private Vector2d toV2d (final Vector2D v ) {
103
100
return new Vector2dImpl (v .getX (), v .getY ());
104
101
}
105
102
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ public static boolean isMove(final Keybinds keybind) {
129
129
*/
130
130
public static Optional <Keybinds > getKeybind (final KeyCode keyCode ) {
131
131
for (final Keybinds keybind : Keybinds .values ()) {
132
- if (keybind .getKeyCode () == keyCode ) {
132
+ if (keybind .getKeyCode (). equals ( keyCode ) ) {
133
133
return Optional .of (keybind );
134
134
}
135
135
}
Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ public synchronized void update() {
40
40
/** {@inheritDoc} */
41
41
@ Override
42
42
public void init () {
43
- // TODO Auto-generated method stub
44
43
throw new UnsupportedOperationException ("Unimplemented method 'init'" );
45
44
}
46
45
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ public synchronized void update() {
41
41
/** {@inheritDoc} */
42
42
@ Override
43
43
public void init () {
44
- // TODO Auto-generated method stub
45
44
throw new UnsupportedOperationException ("Unimplemented method 'init'" );
46
45
}
47
46
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments