Class GUIRow
java.lang.Object
me.block2block.hubparkour.api.gui.GUIRow
The GUIRow class represents a row in a GUI, where each row is identified by a unique row number
and can contain a specified number of GUIItems. It enforces row and column constraints to ensure
proper initialization and manipulation within a GUI grid structure.
-
Constructor Summary
ConstructorsConstructorDescriptionGUIRow(int rowNo) Constructs a new instance ofGUIRowwith a specified row number. -
Method Summary
Modifier and TypeMethodDescriptiongetItem(int column) Retrieves theGUIItemlocated at the specified column index within this row.getRow()Retrieves a copy of the row map, representing the mapping of column indices toGUIItemobjects within this row.intgetRowNo()Retrieves the row number associated with this instance ofGUIRow.voidSets aGUIItemat the specified column index within the row.
-
Constructor Details
-
GUIRow
public GUIRow(int rowNo) Constructs a new instance ofGUIRowwith a specified row number. Ensures that the row number provided is within a valid range.- Parameters:
rowNo- The row number to initialize. Must be between 0 and 5 inclusive.- Throws:
InvalidRowException- If the provided row number is not within the range 0-5.
-
-
Method Details
-
setItem
Sets aGUIItemat the specified column index within the row.- Parameters:
i- The column index where theGUIItemshould be placed. Must be between 0 and 8 inclusive.item- TheGUIItemto be placed in the specified column.- Throws:
InvalidColumnException- If the specified column index is not within the range 0-8.
-
getRowNo
public int getRowNo()Retrieves the row number associated with this instance ofGUIRow.- Returns:
- The row number, which is a value between 0 and 5 inclusive, representing the position of the row within the grid structure.
-
getRow
Retrieves a copy of the row map, representing the mapping of column indices toGUIItemobjects within this row. The returned map ensures the original data remains unmodifiable from outside the instance.- Returns:
- A new map containing the column indices as keys and their
respective
GUIItemobjects as values. The map may be empty if no items have been added to the row.
-
getItem
-