public class Resource extends java.lang.Object implements IPOPBase
| Modifier and Type | Field and Description |
|---|---|
protected float |
bandwidth |
protected float |
flops |
protected float |
memory |
| Constructor and Description |
|---|
Resource() |
Resource(float flops,
float memory,
float bandwidth) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Resource r)
Add another resource to this one, only positive values will be considered
|
void |
addTo(ObjectDescription od)
Set this resource in the OD
|
boolean |
canHandle(Resource resource) |
boolean |
deserialize(POPBuffer buffer)
Deserialize an object from the buffer
|
boolean |
equals(java.lang.Object obj) |
float |
getBandwidth() |
float |
getFlops() |
float |
getMemory() |
int |
hashCode() |
boolean |
serialize(POPBuffer buffer)
Serialize an object into the buffer
|
void |
setBandwidth(float bandwidth) |
void |
setFlops(float flops) |
void |
setMemory(float memory) |
void |
subtract(Resource r)
Subtract another resource to this one, only positive values will be
considered
|
java.lang.String |
toString() |
YamlResource |
toYamlResource() |
protected float flops
protected float memory
protected float bandwidth
public Resource()
public Resource(float flops,
float memory,
float bandwidth)
public void add(Resource r)
r - Another resourcepublic void addTo(ObjectDescription od)
od - A initialized ODpublic void subtract(Resource r)
r - Another resourcepublic float getFlops()
public float getMemory()
public float getBandwidth()
public void setFlops(float flops)
public void setMemory(float memory)
public void setBandwidth(float bandwidth)
public boolean canHandle(Resource resource)
public YamlResource toYamlResource()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic boolean serialize(POPBuffer buffer)
IPOPBasepublic boolean deserialize(POPBuffer buffer)
IPOPBasedeserialize in interface IPOPBasebuffer - The buffer to deserialize frompublic java.lang.String toString()
toString in class java.lang.Object