Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rectangle methods for retrieving edges #197

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

IKupriyanov-HORIS
Copy link

No description provided.

new DoubleVector(getLeft(), getBottom())
);
}

public Iterable<DoubleSegment> getParts() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use List here

result.add(new DoubleSegment(origin, origin.add(new DoubleVector(0, dimension.y))));
result.add(new DoubleSegment(origin.add(dimension), origin.add(new DoubleVector(dimension.x, 0))));
result.add(new DoubleSegment(origin.add(dimension), origin.add(new DoubleVector(0, dimension.y))));
result.add(getTopEdge());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use Arrays.asList(..) instead.

public void getParts() {
Iterator<DoubleSegment> edges = RECTANGLE.getParts().iterator();

assertEquals(TOP_EDGE, edges.next());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use something like assertEquals(Arrays.asList(...), edges)

@solomatov
Copy link
Contributor

@timzam Could you review it further and merge depending on your opinion of the code.

@solomatov solomatov requested a review from timzam October 8, 2017 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants