Specification for V3BiPanelArray
Attributes
| Attribute | Type | Description |
|---|---|---|
_items | V3BiPanelBase[] | Private array of V3BiPanelBase items that the panel array manages. |
Methods
| Method | Description |
|---|---|
constructor | Initializes a new instance of V3BiPanelArray with the provided array of items. |
get items | Returns the array of V3BiPanelBase items. |
set items | Sets the array of V3BiPanelBase items. |
Constructor
Signature:
constructor(items: V3BiPanelBase[])
Parameters:
items(V3BiPanelBase[]): Array of panel items.
Description:
The constructor initializes the V3BiPanelArray instance with the provided items array.
Method: get items
Signature:
get items(): V3BiPanelBase[]
Description:
Returns the array of V3BiPanelBase items.
Method: set items
Signature:
set items(value: V3BiPanelBase[])
Parameters:
value(V3BiPanelBase[]): The array of panel items to set.
Description:
Sets the array of V3BiPanelBase items.
Example Usage
const panels = [
new V3BiPanelBase('panel1'),
new V3BiPanelBase('panel2')
];
const panelArray = new V3BiPanelArray(panels);
console.log(panelArray.items); // Output: [V3BiPanelBase, V3BiPanelBase]
panelArray.items = [new V3BiPanelBase('panel3')];
console.log(panelArray.items); // Output: [V3BiPanelBase]
Scenario Table
| Scenario | Given | When | Then |
|---|---|---|---|
| Create an instance with a non-empty array | The items array contains valid V3BiPanelBase items | I create a new V3BiPanelArray with the items array | The instance should be created with the _items attribute containing the items array. |
| Create an instance with an empty array | The items array is empty | I create a new V3BiPanelArray with the items array | The instance should be created with the _items attribute as an empty array. |
| Get items should return the correct array | The items array contains valid V3BiPanelBase items | I access the items getter | The correct array of V3BiPanelBase items should be returned. |
| Set items should update the array | The items array contains valid V3BiPanelBase items | I update the items using the setter | The _items attribute should be updated with the new array of V3BiPanelBase items. |
| Set items should handle an empty array | The items array is currently non-empty | I update the items with an empty array using the setter | The _items attribute should be updated to an empty array. |
Overview Table
| Attribute | Type | Description |
|---|---|---|
_items | V3BiPanelBase[] | Private array of V3BiPanelBase items that the panel array manages. |
| Method | Description |
|---|---|
constructor | Initializes a new instance of V3BiPanelArray with the provided array of items. |
get items | Returns the array of V3BiPanelBase items. |
set items | Sets the array of V3BiPanelBase items. |
This setup ensures that the V3BiPanelArray class is correctly instantiated and that its methods function as expected under various scenarios.