public class TerminalRectangle extends Object
Modifier and Type | Field | Description |
---|---|---|
int |
height |
|
TerminalPosition |
position |
|
TerminalSize |
size |
|
int |
width |
|
int |
x |
|
int |
xAndWidth |
|
int |
y |
|
int |
yAndHeight |
Constructor | Description |
---|---|
TerminalRectangle(int x,
int y,
int width,
int height) |
Creates a new terminal rect representation at the supplied x y position with the supplied width and height.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object obj) |
|
int |
getColumns() |
|
int |
getRows() |
|
int |
hashCode() |
|
String |
toString() |
|
boolean |
whenContains(int x,
int y,
Runnable op) |
|
boolean |
whenContains(TerminalPosition p,
Runnable op) |
|
TerminalRectangle |
withColumns(int columns) |
Creates a new rect based on this rect, but with a different width
|
TerminalRectangle |
withRows(int rows) |
Creates a new rect based on this rect, but with a different height
|
public final TerminalPosition position
public final TerminalSize size
public final int x
public final int y
public final int width
public final int height
public final int xAndWidth
public final int yAndHeight
public TerminalRectangle(int x, int y, int width, int height)
width
- number of columnsheight
- number of rowspublic int getColumns()
public int getRows()
public TerminalRectangle withColumns(int columns)
columns
- Width of the new rect, in columnspublic TerminalRectangle withRows(int rows)
rows
- Height of the new rect, in rowspublic boolean whenContains(TerminalPosition p, Runnable op)
public boolean whenContains(int x, int y, Runnable op)
Copyright © 2020. All rights reserved.