public class GUIRow extends Object
Constructor and Description |
---|
GUIRow(int rowNo)
Constructs a new instance of
GUIRow with a specified row number. |
Modifier and Type | Method and Description |
---|---|
GUIItem |
getItem(int column)
Retrieves the
GUIItem located at the specified column index within this row. |
Map<Integer,GUIItem> |
getRow()
Retrieves a copy of the row map, representing the mapping of column indices to
GUIItem
objects within this row. |
int |
getRowNo()
Retrieves the row number associated with this instance of
GUIRow . |
void |
setItem(int i,
GUIItem item)
Sets a
GUIItem at the specified column index within the row. |
public GUIRow(int rowNo)
GUIRow
with a specified row number.
Ensures that the row number provided is within a valid range.rowNo
- The row number to initialize. Must be between 0 and 5 inclusive.InvalidRowException
- If the provided row number is not within the range 0-5.public void setItem(int i, GUIItem item)
GUIItem
at the specified column index within the row.i
- The column index where the GUIItem
should be placed.
Must be between 0 and 8 inclusive.item
- The GUIItem
to be placed in the specified column.InvalidColumnException
- If the specified column index is not within the range 0-8.public int getRowNo()
GUIRow
.public Map<Integer,GUIItem> getRow()
GUIItem
objects within this row.
The returned map ensures the original data remains unmodifiable from outside the instance.GUIItem
objects as values. The map may
be empty if no items have been added to the row.public GUIItem getItem(int column)
GUIItem
located at the specified column index within this row.column
- The column index to retrieve the GUIItem
from.
Typically expected to be between 0 and 8 inclusive.GUIItem
at the specified column, or null
if no item exists
at the given index.Copyright © 2025. All rights reserved.