registries

This commit is contained in:
Sergey Solovyev 2012-10-07 20:11:29 +04:00
parent 52e6b4b79d
commit 5f6480ba4e
10 changed files with 14 additions and 17 deletions

View File

@ -1,8 +1,7 @@
package org.solovyev.android.calculator.model; package org.solovyev.android.calculator;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.solovyev.android.calculator.R;
/** /**
* User: serso * User: serso

View File

@ -4,11 +4,10 @@
* or visit http://se.solovyev.org * or visit http://se.solovyev.org
*/ */
package org.solovyev.android.calculator.model; package org.solovyev.android.calculator;
import jscl.math.operator.Operator; import jscl.math.operator.Operator;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.solovyev.android.calculator.*;
import org.solovyev.common.JBuilder; import org.solovyev.common.JBuilder;
import org.solovyev.common.math.MathRegistry; import org.solovyev.common.math.MathRegistry;
@ -34,7 +33,7 @@ public class CalculatorPostfixFunctionsRegistry extends AbstractCalculatorMathRe
@NotNull @NotNull
private static final String POSTFIX_FUNCTION_DESCRIPTION_PREFIX = "c_pf_description_"; private static final String POSTFIX_FUNCTION_DESCRIPTION_PREFIX = "c_pf_description_";
protected CalculatorPostfixFunctionsRegistry(@NotNull MathRegistry<Operator> functionsRegistry, public CalculatorPostfixFunctionsRegistry(@NotNull MathRegistry<Operator> functionsRegistry,
@NotNull MathEntityDao<MathPersistenceEntity> mathEntityDao) { @NotNull MathEntityDao<MathPersistenceEntity> mathEntityDao) {
super(functionsRegistry, POSTFIX_FUNCTION_DESCRIPTION_PREFIX, mathEntityDao); super(functionsRegistry, POSTFIX_FUNCTION_DESCRIPTION_PREFIX, mathEntityDao);
} }

View File

@ -4,13 +4,12 @@
* or visit http://se.solovyev.org * or visit http://se.solovyev.org
*/ */
package org.solovyev.android.calculator.model; package org.solovyev.android.calculator;
import jscl.math.function.IConstant; import jscl.math.function.IConstant;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.solovyev.android.calculator.AbstractCalculatorMathRegistry; import org.solovyev.android.calculator.model.Var;
import org.solovyev.android.calculator.MathEntityDao; import org.solovyev.android.calculator.model.Vars;
import org.solovyev.android.calculator.MathEntityPersistenceContainer;
import org.solovyev.common.JBuilder; import org.solovyev.common.JBuilder;
import org.solovyev.common.math.MathRegistry; import org.solovyev.common.math.MathRegistry;
@ -22,7 +21,7 @@ import java.util.Map;
* Date: 9/29/11 * Date: 9/29/11
* Time: 4:57 PM * Time: 4:57 PM
*/ */
class CalculatorVarsRegistry extends AbstractCalculatorMathRegistry<IConstant, Var> { public class CalculatorVarsRegistry extends AbstractCalculatorMathRegistry<IConstant, Var> {
@NotNull @NotNull
private static final Map<String, String> substitutes = new HashMap<String, String>(); private static final Map<String, String> substitutes = new HashMap<String, String>();
@ -34,7 +33,7 @@ class CalculatorVarsRegistry extends AbstractCalculatorMathRegistry<IConstant, V
substitutes.put("NaN", "nan"); substitutes.put("NaN", "nan");
} }
protected CalculatorVarsRegistry(@NotNull MathRegistry<IConstant> mathRegistry, public CalculatorVarsRegistry(@NotNull MathRegistry<IConstant> mathRegistry,
@NotNull MathEntityDao<Var> mathEntityDao) { @NotNull MathEntityDao<Var> mathEntityDao) {
super(mathRegistry, "c_var_description_", mathEntityDao); super(mathRegistry, "c_var_description_", mathEntityDao);
} }

View File

@ -1,4 +1,4 @@
package org.solovyev.android.calculator.model; package org.solovyev.android.calculator;
import jscl.math.function.IConstant; import jscl.math.function.IConstant;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -17,14 +17,14 @@ public enum VarCategory {
system(100){ system(100){
@Override @Override
boolean isInCategory(@NotNull IConstant var) { public boolean isInCategory(@NotNull IConstant var) {
return var.isSystem(); return var.isSystem();
} }
}, },
my(0) { my(0) {
@Override @Override
boolean isInCategory(@NotNull IConstant var) { public boolean isInCategory(@NotNull IConstant var) {
return !var.isSystem(); return !var.isSystem();
} }
}; };
@ -35,7 +35,7 @@ public enum VarCategory {
this.tabOrder = tabOrder; this.tabOrder = tabOrder;
} }
abstract boolean isInCategory(@NotNull IConstant var); public abstract boolean isInCategory(@NotNull IConstant var);
@NotNull @NotNull
public static List<VarCategory> getCategoriesByTabOrder() { public static List<VarCategory> getCategoriesByTabOrder() {

View File

@ -14,8 +14,8 @@ import org.jetbrains.annotations.Nullable;
import org.solovyev.android.calculator.*; import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.about.CalculatorFragmentType; import org.solovyev.android.calculator.about.CalculatorFragmentType;
import org.solovyev.android.calculator.history.CalculatorHistoryActivity; import org.solovyev.android.calculator.history.CalculatorHistoryActivity;
import org.solovyev.android.calculator.model.AndroidVarCategory; import org.solovyev.android.calculator.AndroidVarCategory;
import org.solovyev.android.calculator.model.VarCategory; import org.solovyev.android.calculator.VarCategory;
/** /**
* User: serso * User: serso