?? variable.java
字號:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package ro.simplex;import ro.utils.Fraction;/** * * @author Doan Chien Thang */public class Variable { private int constraint; private Fraction value; private int index; private String prefix; public Variable(Fraction initValue, int initIndex, String initPrefix, int constraint) { this.value = initValue; this.index = initIndex; this.prefix = initPrefix; this.constraint = constraint; this.value = null; } @Override public String toString() { return prefix + "<sub>" + index + "</sub>"; } public Fraction getValue() { return this.value; } public int getConstraint() { return constraint; } public int getIndex() { return index; } public String getConstraintString() { String result = this.toString(); switch (this.constraint) { case ConstraintTypes.GREATER_THAN: result += " ≥ 0"; break; case ConstraintTypes.LESS_THAN: result += " ≤ 0"; break; case ConstraintTypes.BELONG_R: result += " ∈ R"; break; default: break; } return result; } public String getPrefix() { return prefix; } public boolean equals(Variable variable) { return (prefix.compareTo(variable.getPrefix()) == 0 && index == variable.getIndex()); } public void setValue(Fraction value) { this.value = value; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -