public final class HostList extends Object
Modifier and Type | Method and Description |
---|---|
static <T extends Host> |
getById(List<T> hostList,
int id)
Gets a
Host with a given id. |
static <T extends Host> |
getHostWithFreePe(List<T> hostList)
Gets the first host with free PEs.
|
static <T extends Host> |
getHostWithFreePe(List<T> hostList,
int pesNumber)
Gets the first Host with a specified number of free PEs.
|
static int |
getNumberOfBusyPes(List<? extends Host> hostList)
Gets the total number of BUSY PEs for all Hosts.
|
static int |
getNumberOfFreePes(List<? extends Host> hostList)
Gets the total number of FREE (non-busy) PEs for all Hosts.
|
static int |
getNumberOfPes(List<? extends Host> hostList)
Gets the total number of PEs for all Hosts.
|
static boolean |
setPeStatus(List<? extends Host> hostList,
Pe.Status status,
int hostId,
int peId)
Sets the status of a particular PE on a given Host.
|
public static <T extends Host> T getById(List<T> hostList, int id)
Host
with a given id.T
- the generic typehostList
- the list of existing hostsid
- the host IDpublic static int getNumberOfPes(List<? extends Host> hostList)
hostList
- the list of existing hostspublic static int getNumberOfFreePes(List<? extends Host> hostList)
hostList
- the list of existing hostspublic static int getNumberOfBusyPes(List<? extends Host> hostList)
hostList
- the list of existing hostspublic static <T extends Host> T getHostWithFreePe(List<T> hostList)
T
- the class of Hosts inside the ListhostList
- the list of existing hostspublic static <T extends Host> T getHostWithFreePe(List<T> hostList, int pesNumber)
T
- the class of Hosts inside the ListhostList
- the list of existing hostspesNumber
- the pes numberpublic static boolean setPeStatus(List<? extends Host> hostList, Pe.Status status, int hostId, int peId)
hostList
- the list of existing hostsstatus
- the new PE statushostId
- the host idpeId
- the id of the PE to set the statusCopyright © 2015–2018 Systems, Security and Image Communication Lab - Instituto de Telecomunicações (IT) - Universidade da Beira Interior (UBI) - Instituto Federal de Educação Ciência e Tecnologia do Tocantins (IFTO). All rights reserved.