diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-08 12:44:57 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-13 08:49:23 +0200 |
commit | 68cd011c907d00493bf2bfde531c1e244819596b (patch) | |
tree | 0225318c908b00faaa701a19aaf7aa567c3582a0 /nlpsolver | |
parent | java: reduce scope, make member classes private (diff) | |
download | core-68cd011c907d00493bf2bfde531c1e244819596b.tar.gz core-68cd011c907d00493bf2bfde531c1e244819596b.zip |
java: reduce scope, make some methods private
found by UCDetector
Change-Id: Ib1425edde146193a65c242dc159b7e3fbf0e4a2e
Diffstat (limited to 'nlpsolver')
10 files changed, 24 insertions, 24 deletions
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java index 5482b180cd88..a67fe77e12c0 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java @@ -86,7 +86,7 @@ public class DEPSAgent implements ILibEngine { pbest_t = pbest; } - protected AbsGTBehavior getGTBehavior() { + private AbsGTBehavior getGTBehavior() { if (Math.random()<switchP) { return deGTBehavior; } else { diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java index b215c348e3f4..3e7b32e855fc 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java @@ -77,7 +77,7 @@ public class DEGTBehavior extends AbsGTBehavior implements ILibEngine { Library.replace(qualityComparator, trailPoint, pbest_t); } - protected SearchPoint[] getReferPoints() { + private SearchPoint[] getReferPoints() { SearchPoint[] referPoints = new SearchPoint[DVNum*2]; for(int i=0; i<referPoints.length; i++) { referPoints[i] = socialLib.getSelectedPoint(RandomGenerator.intRangeRandom(0, socialLib.getPopSize()-1)); diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java index 3b233d751568..b00ece9652ee 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java @@ -53,13 +53,13 @@ public class GlobalString { return getMeaningfulLine(outReader, NEGLECT_TAG); } - public static int getCharLoc(char data, String str) { + private static int getCharLoc(char data, String str) { for(int i=0; i<str.length(); i++) { if(str.charAt(i)==data) return i; } return -1; } - public static String trim(String origStr, String discardStr) { + private static String trim(String origStr, String discardStr) { String str = origStr; do { if(str.length()==0) return str; @@ -69,7 +69,7 @@ public class GlobalString { } while(true); } - public static boolean getFirstCharExist(String str, String chars) throws Exception { + private static boolean getFirstCharExist(String str, String chars) throws Exception { int neglectFirstCharLength = chars.length(); for(int i=0; i<neglectFirstCharLength; i++) { if(str.startsWith(chars.substring(i, i+1))) { @@ -79,7 +79,7 @@ public class GlobalString { return false; } - public static String getMeaningfulLine(BufferedReader outReader, String neglectFirstChars) throws Exception { + private static String getMeaningfulLine(BufferedReader outReader, String neglectFirstChars) throws Exception { String str; boolean isNeglect = true; do { @@ -95,7 +95,7 @@ public class GlobalString { return str; } - public static String[] getMeaningfulLines(String srcStr, String neglectFirstChars) throws Exception { + private static String[] getMeaningfulLines(String srcStr, String neglectFirstChars) throws Exception { StringReader outStringReader = new StringReader(srcStr); BufferedReader outReader = new BufferedReader(outStringReader); ArrayList<String> origData = new ArrayList<String>(); @@ -112,7 +112,7 @@ public class GlobalString { /** * convert vector to 1D String array */ - public static String[] convert1DVectorToStringArray(ArrayList<String> toToConvert) { + private static String[] convert1DVectorToStringArray(ArrayList<String> toToConvert) { if (toToConvert==null) return null; String[] objs = new String[toToConvert.size()]; for (int i=0; i<toToConvert.size(); i++) { @@ -121,7 +121,7 @@ public class GlobalString { return(objs); } - public static String getObjString(Object nObj) { + private static String getObjString(Object nObj) { if(nObj instanceof String) return (String)nObj; return nObj.toString(); } diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java index 47d03c1256bf..5a3f44612592 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java @@ -89,7 +89,7 @@ public static double doubleRangeRandom(double lowLimit,double upLimit){ return realV; } - public static int[] randomSelection(int[] totalIndices, int times) { + private static int[] randomSelection(int[] totalIndices, int times) { if (times>=totalIndices.length) { return totalIndices; } diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/ACRComparator.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/ACRComparator.java index 1efd3c7ac8af..fc4ee535fbc2 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/ACRComparator.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/ACRComparator.java @@ -56,7 +56,7 @@ public class ACRComparator implements IGoodnessCompareEngine, IUpdateCycleEngine epsilon_t = lib.getExtremalVcon(true); } - static public int compare(double data1, double data2) { + static private int compare(double data1, double data2) { if (data1 < data2) return LESS_THAN; else if (data1 > data2) diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/BCHComparator.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/BCHComparator.java index 695fb6fe8894..0337b2415e7f 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/BCHComparator.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/BCHComparator.java @@ -30,7 +30,7 @@ public class BCHComparator implements IGoodnessCompareEngine { /* check the magnitude of two array, the frontial is more important **/ - public static int compareArray(double[] fit1, double[] fit2) { + private static int compareArray(double[] fit1, double[] fit2) { for (int i=0; i<fit1.length; i++) { if (fit1[i]>fit2[i]) { return LARGER_THAN; //Large than diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java index 80be5148c8f2..2bebff6f7fda 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java @@ -81,7 +81,7 @@ public class SCAgent { return trailPoint; } - protected void generatePoint(ILocationEngine tempPoint) { + private void generatePoint(ILocationEngine tempPoint) { SearchPoint Xmodel, Xrefer, libBPoint; // choose Selects a better point (libBPoint) from externalLib (L) based @@ -115,7 +115,7 @@ public class SCAgent { } // 1---model point, 2---refer point - public boolean inferPoint(ILocationEngine newPoint, ILocationEngine point1,ILocationEngine point2, DesignSpace space){ + private boolean inferPoint(ILocationEngine newPoint, ILocationEngine point1,ILocationEngine point2, DesignSpace space){ double[] newLoc = newPoint.getLocation(); double[] real1 = point1.getLocation(); double[] real2 = point2.getLocation(); diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java index 35e2ac0c7775..bd620fa5bb9c 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java @@ -54,7 +54,7 @@ public class DesignSpace { return dimProps[dim].paramBound.boundAdjust(val); } - public void annulusAdjust (double[] location){ + private void annulusAdjust (double[] location){ for (int i=0; i<getDimension(); i++) { location[i] = dimProps[i].paramBound.annulusAdjust(location[i]); } diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java index e3db5d16fa2f..9d779afe7225 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java @@ -168,7 +168,7 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver { protected IEvolutionarySolverStatusDialog m_solverStatusDialog; - protected void prepareVariables(double[][] variableBounds) { + private void prepareVariables(double[][] variableBounds) { m_variables.clear(); for (int i = 0; i < m_variableCount; i++) { Variable var = new Variable(m_variableMap[i], i); @@ -342,7 +342,7 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver { super.finalizeSolve(); } - protected boolean checkConstraints() { + private boolean checkConstraints() { boolean result = true; for (int i = 0; i < m_constraintCount && result; i++) { if (m_extConstraints[i].Left.getError() == 0) { diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java index ef7ae96debef..7401af7eda0c 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java @@ -175,7 +175,7 @@ public abstract class BaseNLPSolver extends WeakBase Row = row; } - public CellRangeAddress getCellRangeAddress(int lastRow) { + private CellRangeAddress getCellRangeAddress(int lastRow) { CellRangeAddress result = new CellRangeAddress(); result.Sheet = Sheet; result.StartColumn = StartCol; @@ -341,11 +341,11 @@ public abstract class BaseNLPSolver extends WeakBase return m_currentParameters; } - protected XCell getCell(CellAddress cellAddress) { + private XCell getCell(CellAddress cellAddress) { return getCell(cellAddress.Column, cellAddress.Row, cellAddress.Sheet); } - protected XCell getCell(int col, int row, int sheet) { + private XCell getCell(int col, int row, int sheet) { try { XSpreadsheets xSpreadsheets = m_document.getSheets(); XIndexAccess xSheetIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); @@ -365,7 +365,7 @@ public abstract class BaseNLPSolver extends WeakBase cellRangeAddress.StartRow, cellRangeAddress.EndColumn, cellRangeAddress.EndRow); } - protected XCellRangeData getCellRangeData(int sheet, int startCol, int startRow, int endCol, int endRow) { + private XCellRangeData getCellRangeData(int sheet, int startCol, int startRow, int endCol, int endRow) { try { XSpreadsheets xSpreadsheets = m_document.getSheets(); XIndexAccess xSheetIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); @@ -380,12 +380,12 @@ public abstract class BaseNLPSolver extends WeakBase return null; } - protected XChartDataArray getChartDataArray(CellRangeAddress cellRangeAddress) { + private XChartDataArray getChartDataArray(CellRangeAddress cellRangeAddress) { return getChartDataArray(cellRangeAddress.Sheet, cellRangeAddress.StartColumn, cellRangeAddress.StartRow, cellRangeAddress.EndColumn, cellRangeAddress.EndRow); } - protected XChartDataArray getChartDataArray(int sheet, int startCol, int startRow, int endCol, int endRow) { + private XChartDataArray getChartDataArray(int sheet, int startCol, int startRow, int endCol, int endRow) { try { XSpreadsheets xSpreadsheets = m_document.getSheets(); XIndexAccess xSheetIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); @@ -487,7 +487,7 @@ public abstract class BaseNLPSolver extends WeakBase } // <editor-fold defaultstate="collapsed" desc="Helper functions"> - protected void lockDocument(boolean lock) { + private void lockDocument(boolean lock) { if (lock) m_xModel.lockControllers(); else |