public class SlotPos
extends Object
Represents a slot as a position in a grid of slots with rows and columns.
The class provides methods for creating a position with row and column values, creating a position from a slot number,
retrieving the slot number, as well as getting the row and column values.
Since:
1.5.0.0
Author:
creatorfromhell
Field Summary
Fields
private final int
The column index in the grid.
private final int
The row index in the grid.
Constructor Summary
Constructors
Constructs a
SlotPos
from a slot number.
Constructs a
SlotPos
with specified row and column values.
Method Summary
All Methods Instance Methods Concrete Methods
int
int
int
Calculates and returns the slot number based on the current row and column values.
Field Details
row
private final int row
The row index in the grid.
column
private final int column
The column index in the grid.
Constructor Details
SlotPos
public SlotPos (int row,
int column)
Constructs a
SlotPos
with specified row and column values.
Parameters:
row
- The row index.
column
- The column index.
SlotPos
public SlotPos (int slot)
Constructs a
SlotPos
from a slot number.
Parameters:
slot
- The slot number.
Method Details
slot
public int slot ()
Calculates and returns the slot number based on the current row and column values.
Returns:
The slot number.
getRow
public int getRow ()
getColumn
public int getColumn ()