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
- name of the processor (logic part of the server)ip
- String with the IP address of the serveronline
- boolean to indicate if the server is on line.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 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.public void updatePeripheral(Peripheral peripheral, int pos)
peripheral
- Peripheral to update.pos
- Position in the list of peripherals to update.public Peripheral getPeripheral(java.lang.String name)
name
- String with the name of the peripheral to search.public Peripheral getPeripheral(int pos)
pos
- Position in the list of peripheralspublic 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