|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.soton.itinnovation.grid.service.types.Constraint
public class Constraint
Class to define all constraint types. In an SLATemplate, the startTime will not be defined as it is filled in when a proposal is accepted. If the duration is set and repeating is false, then it is a FixedConstraint and repeating is true, then it is an infinitely repeating PeriodicConstraint If the duration is not set it is an IndefiniteConstraint (value of repeating is irrelevent)
| Field Summary | |
|---|---|
Bound |
bound
|
UsageType |
type
|
| Constructor Summary | |
|---|---|
Constraint()
|
|
Constraint(Constraint c)
Deprecated. |
|
Constraint(Metric metric,
UsageType usageType,
Bound bound,
double limit,
Calendar startTime)
|
|
| Method Summary | |
|---|---|
boolean |
canAccommodate(Constraint pConstraint,
double used)
Given a proposed constraint and the amount that has been used in this constraint, check if the proposed constraint can fit in this constraint. |
int |
compareTo(Constraint c)
|
Constraint |
copyWithNullId()
Copy the constraint without the hibernate id |
boolean |
equals(Object obj)
Check if this object is equal to another object. |
GregorianCalendar[] |
findTimeSpan(Calendar time)
Returns the start and end time of the repeating period that the given time falls in. |
String |
getBound()
|
double |
getContention()
|
TimePeriod |
getDuration()
|
Long |
getId()
|
double |
getLimit()
|
Metric |
getMetric()
|
Calendar |
getStartTime()
|
String |
getType()
|
static TypeDesc |
getTypeDesc()
Return type metadata object. |
boolean |
hasBreach(double amount)
Return true if the amount passed in does not satisfy the Constraint's inequality. |
int |
hashCode()
Calculate the hash code for this object. |
boolean |
isFixed()
|
boolean |
isIndefinite()
|
boolean |
isPeriodic()
|
boolean |
isPrivate()
|
boolean |
isRepeating()
|
String |
prettyPrint()
|
String |
prettyPrint(boolean html)
|
void |
setBound(String argBound)
|
void |
setContention(double argContention)
|
void |
setDuration(TimePeriod argDuration)
|
void |
setId(Long argId)
|
void |
setLimit(double argLimit)
|
void |
setMetric(Metric argMetric)
|
void |
setPrivate(boolean argPriv)
|
void |
setRepeating(boolean argRepeating)
|
void |
setStartTime(Calendar argStartTime)
|
void |
setType(String argType)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public Bound bound
public UsageType type
| Constructor Detail |
|---|
public Constraint()
public Constraint(Metric metric,
UsageType usageType,
Bound bound,
double limit,
Calendar startTime)
@Deprecated public Constraint(Constraint c)
| Method Detail |
|---|
public Constraint copyWithNullId()
public Long getId()
public void setId(Long argId)
public Metric getMetric()
public void setMetric(Metric argMetric)
public String getBound()
public void setBound(String argBound)
public String getType()
public void setType(String argType)
public boolean isPrivate()
public void setPrivate(boolean argPriv)
public double getLimit()
public void setLimit(double argLimit)
public double getContention()
public void setContention(double argContention)
public Calendar getStartTime()
public void setStartTime(Calendar argStartTime)
public TimePeriod getDuration()
public void setDuration(TimePeriod argDuration)
public boolean isRepeating()
public void setRepeating(boolean argRepeating)
public String prettyPrint()
public String prettyPrint(boolean html)
public String toString()
toString in class Objectpublic boolean isIndefinite()
public boolean isPeriodic()
public boolean isFixed()
public GregorianCalendar[] findTimeSpan(Calendar time)
public boolean hasBreach(double amount)
public boolean canAccommodate(Constraint pConstraint,
double used)
public boolean equals(Object obj)
For the definition of the object equivalence relation
see Object.equals(Object).
equals in class Objectobj - another, possibly equal object.
Object.equals(Object)public int hashCode()
The rules laid out in J. Blosh's Effective Java are used for the hash code calculation.
hashCode in class ObjectObject.hashCode()public int compareTo(Constraint c)
compareTo in interface Comparable<Constraint>public static TypeDesc getTypeDesc()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||