public class Constraint extends Object implements Serializable, Cloneable
Constructor and Description |
---|
Constraint(CompareType type,
double constant) |
Constraint(CompareType type,
double constant,
String description) |
Modifier and Type | Method and Description |
---|---|
void |
addTerm(double coefficient,
Variable var) |
void |
addTerm(double coefficient,
Variable varA,
Variable varB) |
void |
addTerm(LinearTerm term) |
void |
addTerm(QuadraticTerm term) |
protected Object |
clone() |
boolean |
equals(Object obj) |
double |
getConstant() |
String |
getDescription() |
Collection<LinearTerm> |
getLinearTerms() |
Collection<QuadraticTerm> |
getQuadraticTerms() |
Collection<LinearTerm> |
getSortedLinearTerms() |
Collection<QuadraticTerm> |
getSortedQuadraticTerms() |
Collection<Term> |
getTerms() |
CompareType |
getType() |
int |
hashCode() |
boolean |
hasLinearTerms() |
boolean |
hasQuadraticTerms() |
int |
linearSize() |
int |
quadraticSize() |
void |
setConstant(double constant) |
void |
setDescription(String desc) |
void |
setType(CompareType type) |
int |
size() |
String |
toString() |
Constraint |
typedClone() |
public Constraint(CompareType type, double constant)
constTerm
- type
- public Constraint(CompareType type, double constant, String description)
public double getConstant()
public void setConstant(double constant)
constant
- The constant to set.public String getDescription()
public void setDescription(String desc)
public CompareType getType()
public void setType(CompareType type)
public boolean hasLinearTerms()
public void addTerm(LinearTerm term)
public void addTerm(double coefficient, Variable var)
public int linearSize()
public Collection<LinearTerm> getLinearTerms()
public Collection<LinearTerm> getSortedLinearTerms()
public boolean hasQuadraticTerms()
public void addTerm(QuadraticTerm term)
public int quadraticSize()
public Collection<QuadraticTerm> getQuadraticTerms()
public Collection<QuadraticTerm> getSortedQuadraticTerms()
public Collection<Term> getTerms()
public int size()
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public Constraint typedClone()
Copyright © 2017. All rights reserved.