GraphLab Project

graphlab.platform.lang
Class BoundedInteger

java.lang.Object
  extended by graphlab.platform.lang.BoundedInteger
All Implemented Interfaces:
AtomAttribute<java.lang.Integer>, Validator<java.lang.Integer>, java.io.Serializable

public class BoundedInteger
extends java.lang.Object
implements Validator<java.lang.Integer>, AtomAttribute<java.lang.Integer>

represents a bounded integer: it's value only can be in the (max ,min) bound.

Author:
azin azadi
See Also:
Serialized Form

Constructor Summary
BoundedInteger(int value)
          sets the max and min to integer.maxvalue , minvalue
BoundedInteger(int value, int max, int min)
           
 
Method Summary
 int getMax()
           
 int getMin()
           
 java.lang.Integer getValue()
           
 boolean isValid(java.lang.Integer xx)
          is xx in bounds?
 void setMax(int max)
           
 void setMin(int min)
           
 boolean setValue(java.lang.Integer value)
          returns true if value is in the bounds of this bounded integer and set the current value
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoundedInteger

public BoundedInteger(int value)
sets the max and min to integer.maxvalue , minvalue

Parameters:
value -

BoundedInteger

public BoundedInteger(int value,
                      int max,
                      int min)
Method Detail

getMax

public int getMax()

setMax

public void setMax(int max)

getMin

public int getMin()

setMin

public void setMin(int min)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setValue

public boolean setValue(java.lang.Integer value)
returns true if value is in the bounds of this bounded integer and set the current value

Specified by:
setValue in interface AtomAttribute<java.lang.Integer>

getValue

public java.lang.Integer getValue()
Specified by:
getValue in interface AtomAttribute<java.lang.Integer>

isValid

public boolean isValid(java.lang.Integer xx)
is xx in bounds?

Specified by:
isValid in interface Validator<java.lang.Integer>

GraphLab Project