Skip to content

New rectangle methods for retrieving edges#197

Open
Ivan Kupriyanov (IKupriyanov-HORIS) wants to merge 5 commits into
JetBrains:masterfrom
IKupriyanov-HORIS:new-rectangle-methods
Open

New rectangle methods for retrieving edges#197
Ivan Kupriyanov (IKupriyanov-HORIS) wants to merge 5 commits into
JetBrains:masterfrom
IKupriyanov-HORIS:new-rectangle-methods

Conversation

@IKupriyanov-HORIS

Copy link
Copy Markdown

No description provided.

);
}

public Iterable<DoubleSegment> getParts() {

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

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