|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lens.server.api.priority.RangeConf<K,V>
K - Key type. Integer in the grade range exampleV - Value Type. String(or a Grade class) in the grade range examplepublic abstract class RangeConf<K extends Comparable<K>,V>
Class for storing range configurations. An Example would be grading system. The value F,30,D,40,C,60,B,80,A corresponds to a system where - inf < marks <= 30 : F 30 < marks <= 40 : D 40 < marks <= 60 : C 60 < marks <= 80 : B 80 < marks <= + Inf : A
rangeConfInstance.get(marks) would give you the grade depending on the range. The utility is for easily storing range configs in config xml files. Implementation is done by storing the least value(floor) and keeping a treemap on rest of values
| Method Summary | |
|---|---|
V |
get(K key)
Get method. |
protected abstract String |
getDefaultConf()
When null/blank conf string passed, this would be the value from which data structure will be formed |
protected abstract K |
parseKey(String s)
parse key type from its string representation |
protected abstract V |
parseValue(String s)
parse value type from its string representation |
String |
toString()
toString representation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
protected abstract K parseKey(String s)
protected abstract V parseValue(String s)
protected abstract String getDefaultConf()
public V get(K key)
key -
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||