Skip to content

New rectangle methods for retrieving edges#197

Open
IKupriyanov-HORIS wants to merge 5 commits intoJetBrains:masterfrom
IKupriyanov-HORIS:new-rectangle-methods
Open

New rectangle methods for retrieving edges#197
IKupriyanov-HORIS wants to merge 5 commits intoJetBrains:masterfrom
IKupriyanov-HORIS:new-rectangle-methods

Conversation

@IKupriyanov-HORIS
Copy link

No description provided.

);
}

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