@Beta public final class BandwidthConstraint extends BooleanConstraint
Constructor and Description |
---|
BandwidthConstraint(Bandwidth bandwidth)
Creates a new bandwidth constraint.
|
Modifier and Type | Method and Description |
---|---|
Bandwidth |
bandwidth()
Returns the bandwidth required by this constraint.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isValid(Link link,
ResourceContext context)
Returns true if the specified link satisfies the constraint.
|
static BandwidthConstraint |
of(double v,
DataRateUnit unit)
Creates a new bandwidth constraint.
|
java.lang.String |
toString() |
cost, validate
public BandwidthConstraint(Bandwidth bandwidth)
bandwidth
- required bandwidthpublic static BandwidthConstraint of(double v, DataRateUnit unit)
v
- required amount of bandwidthunit
- DataRateUnit
of v
BandwidthConstraint
instance with given bandwidth requirementpublic boolean isValid(Link link, ResourceContext context)
BooleanConstraint
isValid
in class BooleanConstraint
link
- link to be validatedcontext
- resource context for checking available resourcespublic Bandwidth bandwidth()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object