public class Building
extends java.lang.Object
Constructor and Description |
---|
Building(int numberOfFloors)
Creates a building component wrapper based on the number of floors
|
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Object> |
everythingButMaintenance() |
java.util.List<java.lang.Object> |
flatten()
Flattens this object's components into a single list
|
ControlPanel.CabinControlPanel |
getCabin()
The CabinControlPanel contains all components contained in the elevator cabin
|
java.util.List<java.lang.Object> |
getComponents()
The stored list of components of this Component wrapper
|
java.util.List<ControlPanel.FloorControlPanel> |
getFloors()
The floors contains each floor of the building in a list, from floor 1 to floor n.
|
Hoistway |
getHoistway()
The Hoistway contains all components contained in the elevator hoistway
|
ControlPanel.MaintenanceControlPanel |
getMaintenance()
The MaintenanceControlPanel contains all components contained on the elevator maintenance control panel
|
java.util.List<java.lang.Object> |
getObjectByType(java.lang.Class<?> type,
java.util.List<java.lang.Object> list)
A method for unpacking all objects of a specific type from inside the building by passing a Class argument
|
io.elevator.building.Component |
setComponents(java.util.List<java.lang.Object> components)
Sets the stored list of this Component wrapper's components to be the passed param
|
io.elevator.building.Component |
setComponents(java.lang.Object... components)
Sets the stored list of this Component wrapper's components to be the passed params
|
java.lang.String |
toString() |
public Building(int numberOfFloors)
numberOfFloors
- the number of floors in the buildingpublic final java.util.List<ControlPanel.FloorControlPanel> getFloors()
public final ControlPanel.CabinControlPanel getCabin()
public final Hoistway getHoistway()
public final ControlPanel.MaintenanceControlPanel getMaintenance()
public java.util.List<java.lang.Object> getObjectByType(java.lang.Class<?> type, java.util.List<java.lang.Object> list)
type
- the class (e.g. Button.class) of sensor to unpacklist
- the list to unpack frompublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<java.lang.Object> flatten()
public java.util.List<java.lang.Object> everythingButMaintenance()
public io.elevator.building.Component setComponents(java.lang.Object... components)
components
- The array of components to addpublic io.elevator.building.Component setComponents(java.util.List<java.lang.Object> components)
components
- The list of components to addpublic java.util.List<java.lang.Object> getComponents()