|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ace.moab.api.global.MoabLimits<T>
T
- public class MoabLimits<T extends java.lang.Number>
Represents hard and soft limits in Moab. This class attempts to mimic the same limit properties Moab applies to its limits. From the Moab documentation: 'If no soft limit is specified or the soft limit is less constraining than the hard limit, the soft limit is set equal to the hard limit.' This means that user-specified soft limits can and will be automatically changed to fit inside the hard limits set.
Setting soft limits that contradict hard limits will not throw any exceptions, but this class will internally change the soft limits to be compatible with the existing hard limits. In other words, setters to soft limits will never change hard limits, but it might not change it to equal the inputs.
Setting hard limits might cause the soft limits to be updated (if they are less strict).
Constructor Summary | |
---|---|
MoabLimits(T hardMin,
T hardMax)
Creates hard limits as specified by the input parameters. |
|
MoabLimits(T softMin,
T softMax,
T hardMin,
T hardMax)
Creates hard and soft limits as specified by the input parameters. |
Method Summary | |
---|---|
int |
compareTo(MoabLimits<T> o)
|
T |
getHardMax()
Get the hard maximum value. |
T |
getHardMin()
Get the hard minimum value. |
com.moab.api.util.NumberRange<T> |
getHardRange()
Return the hard limit range (min to max) |
T |
getSoftMax()
Get the soft maximum value. |
T |
getSoftMin()
Get the soft minimum value. |
com.moab.api.util.NumberRange<T> |
getSoftRange()
Return the soft limit range (min to max). |
void |
setHardMax(T hardMax)
Sets the hard maximum limit. |
void |
setHardMin(T hardMin)
Sets the hard minimum limit. |
void |
setSoftMax(T softMax)
Attempts to set the soft maximum limit. |
void |
setSoftMin(T softMin)
Attempts to set the soft minimum limit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MoabLimits(T softMin, T softMax, T hardMin, T hardMax)
softMin
- The soft minimum value. Moab can violate this value if extra
resources exist.softMax
- The soft maximum value. Moab can violate this value if extra
resources exist.hardMin
- The hard minimum value. Cannot be violated.hardMax
- The hard maximum value. Cannot be violated.public MoabLimits(T hardMin, T hardMax)
hardMin
- The hard minimum value. Cannot be violated.hardMax
- The hard maximum value. Cannot be violated.Method Detail |
---|
public int compareTo(MoabLimits<T> o)
compareTo
in interface java.lang.Comparable<MoabLimits<T extends java.lang.Number>>
public com.moab.api.util.NumberRange<T> getHardRange()
public com.moab.api.util.NumberRange<T> getSoftRange()
public void setSoftMin(T softMin)
softMin
- The new soft minimum value.public void setSoftMax(T softMax)
softMax
- The new soft maximum value.public void setHardMin(T hardMin)
Theoretically, this method could change the soft min, soft max, hard min, and hard max.
hardMin
- The new hard minimum value.public void setHardMax(T hardMax)
Theoretically, this method could change the soft min, soft max, hard min, and hard max.
hardMax
- The new hard maximum value.public T getSoftMin()
public T getSoftMax()
public T getHardMin()
public T getHardMax()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |