public code v1
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package flintstones.helper.ahp;
|
||||
|
||||
public class AHPHelper {
|
||||
|
||||
/** The numeric labels. */
|
||||
private static final String[] numericLabels = new String[]{
|
||||
"1/9", "1/8", "1/7", "1/6", "1/5", "1/4", "1/3", "1/2",
|
||||
"1",
|
||||
"2" , "3", "4", "5", "6", "7", "8", "9"};
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see flintstones.entity.domain.Domain#midpoint()
|
||||
*/
|
||||
public static double getMidPoint() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the labels.
|
||||
*
|
||||
* @return the labels
|
||||
*/
|
||||
public static String[] getLabels() {
|
||||
return numericLabels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the inverse index.
|
||||
*
|
||||
* @param index the index
|
||||
* @return the inverse index
|
||||
*/
|
||||
public static int getInverseIndex( int index ) {
|
||||
int lastIndex = numericLabels.length -1; // 16 -> 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
|
||||
int compIndex = lastIndex - index; // 16-5 = 11. 1/4 => 4.
|
||||
return compIndex;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user