Repository navigation
Coordinate step2 complete - #109
Merged
Merged
Conversation
javajigi
suggested changes
Oct 15, 2018
| Parcer parcer = new Parcer(getCoordinateValue()); | ||
| PointList pl = new PointList(parcer.makePostion()); | ||
| List<Point> pointList = pl.makePointList(); //pointList에 모든 point들을 담는다 | ||
| Line line = new Line(pointList); |
Contributor
There was a problem hiding this comment.
Line line = new Line(parcer.makePostion);
과 같이 바로 구현하는 것은 어떨까? PointList를 생성하고 List를 꺼내는 일이 왜 필요한가?
오타 신고 : parcer -> parser, makePostion -> makePosition
|
|
||
| public List<Integer[]> makePostionList(String[] temp) { | ||
| List<Integer[]> pos = new ArrayList<>(); | ||
| for (int i = 0; i < temp.length; i++) { |
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| public class Parcer { |
Contributor
There was a problem hiding this comment.
이런 문자열 파싱과 같은 클래스의 메소드는 인스턴스 메소드가 아니라 클래스 메소드로 구현하는 것이 일반적임
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| public class Parcer { |
Contributor
There was a problem hiding this comment.
외부에서 접근하지 않고 내부에서만 접근하는 메소드의 접근 제어자는 public 이 아니라 private으로 구현한다.
| this.p2 = pointList.get(1); | ||
| } | ||
|
|
||
| public double calcLength() { |
Contributor
There was a problem hiding this comment.
이 메소드의 구현을 Point에서 구현하면 어떨까?
return p1.calcLength(p2);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
step2 complete
please give me the feedback
thank you