Package org.opt4j.core.genotype
Class IntegerBounds
- java.lang.Object
-
- org.opt4j.core.genotype.IntegerBounds
-
- All Implemented Interfaces:
Bounds<java.lang.Integer>
public class IntegerBounds extends java.lang.Object implements Bounds<java.lang.Integer>
TheIntegerBounds
is an implementation of theBounds
for theIntegerGenotype
that accepts arrays as well as lists for as bounds.
-
-
Constructor Summary
Constructors Constructor Description IntegerBounds(int[] lower, int[] upper)
Constructs aIntegerBounds
with arrays.IntegerBounds(java.util.List<java.lang.Integer> lower, java.util.List<java.lang.Integer> upper)
Constructs aIntegerBounds
with lists.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integer
getLowerBound(int index)
Returns the lower bound for thei
-th element.java.lang.Integer
getUpperBound(int index)
Returns the upper bound for thei
-th element.
-
-
-
Constructor Detail
-
IntegerBounds
public IntegerBounds(int[] lower, int[] upper)
Constructs aIntegerBounds
with arrays.- Parameters:
lower
- the lower boundsupper
- the upper bounds
-
IntegerBounds
public IntegerBounds(java.util.List<java.lang.Integer> lower, java.util.List<java.lang.Integer> upper)
Constructs aIntegerBounds
with lists.- Parameters:
lower
- the lower boundsupper
- the upper bounds
-
-
Method Detail
-
getLowerBound
public java.lang.Integer getLowerBound(int index)
Description copied from interface:Bounds
Returns the lower bound for thei
-th element.- Specified by:
getLowerBound
in interfaceBounds<java.lang.Integer>
- Parameters:
index
- thei
-th element- Returns:
- the lower bound of the
i
-th element
-
getUpperBound
public java.lang.Integer getUpperBound(int index)
Description copied from interface:Bounds
Returns the upper bound for thei
-th element.- Specified by:
getUpperBound
in interfaceBounds<java.lang.Integer>
- Parameters:
index
- thei
-th element- Returns:
- the upper bound of the
i
-th element
-
-