public class Processor
extends java.lang.Object
Constructor and Description |
---|
Processor()
Processor: Constructor without parameters.
|
Processor(java.lang.String name,
java.lang.String ip,
boolean online)
Processor: Constructor with parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addPeripheral(Peripheral peripheral)
addPeripheral: add a peripheral to this processor.
|
java.lang.String |
getIp()
getIp: return the IP address of the processor (Logical Server).
|
java.util.ArrayList<Peripheral> |
getlistPeripherals()
getlistPeripherals: return the list of peripherals of this processor.
|
java.lang.String |
getName()
getName: return the name of the processor (Logical Server).
|
Peripheral |
getPeripheral(int pos)
getPeripheral: return the peripheral in specified position.
|
Peripheral |
getPeripheral(java.lang.String name)
getPeripheral: return the peripheral with specified name.
|
java.lang.String |
getType()
getType: return the type of processor.
|
boolean |
isOnline()
isOnline: return if the processor (Logical Server) is online.
|
void |
setIp(java.lang.String ip)
stIp: set the IP address of the processor (Logical Server).
|
void |
setListPeripherals(java.util.ArrayList<Peripheral> listPeripherals)
setListPeripherals: set the list of peripherals of this processor.
|
void |
setName(java.lang.String name)
setName: set the name of the processor (Logical Server).
|
void |
setOnline(boolean online)
setline: mark a processor (Logical Server) online.
|
void |
setType(java.lang.String type)
setType: set the type of processor.
|
java.lang.String |
toString()
toString: return the string with the processor values.
|
void |
updatePeripheral(Peripheral peripheral,
int pos)
updatePeripheral: update the peripheral in specified position.
|
public Processor()
public Processor(java.lang.String name, java.lang.String ip, boolean online)
name
- of the logical server.ip
- IP address of the processor.online
- Indicate if the server is online.public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to setpublic java.lang.String getIp()
public void setIp(java.lang.String ip)
ip
- the IP address to setpublic boolean isOnline()
public void setOnline(boolean online)
online
- the online to setpublic java.util.ArrayList<Peripheral> getlistPeripherals()
public void setListPeripherals(java.util.ArrayList<Peripheral> listPeripherals)
listPeripherals
- the listPeripherals to setpublic void addPeripheral(Peripheral peripheral)
peripheral
- Peripheral to add to the list of peripherals.public void updatePeripheral(Peripheral peripheral, int pos)
peripheral
- the peripheral to update in specified position.pos
- Position to update.public Peripheral getPeripheral(java.lang.String name)
name
- of the peripheral to searchpublic Peripheral getPeripheral(int pos)
pos
- position in the list to get the peripheral.public java.lang.String getType()
public void setType(java.lang.String type)
type
- * the type to setpublic java.lang.String toString()
toString
in class java.lang.Object