\r
package org.apache.poi.ss.usermodel;\r
\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
/**\r
* High level representation for the Icon / Multi-State Formatting \r
* component of Conditional Formatting settings\r
public final int num;\r
/** Name (system) of the set */\r
public final String name;\r
+ \r
public String toString() {\r
- return id + " - " + (name==null?"default":name);\r
+ return id + " - " + getName();\r
+ }\r
+ private String getName() {\r
+ return (name==null?"default":name);\r
}\r
+ \r
+ public static IconSet byId(int id) { return byId[id]; }\r
+ public static IconSet byName(String name) { return byName.get(name); }\r
+ \r
+ private static final IconSet[] byId = new IconSet[0x10];\r
+ private static final Map<String,IconSet> byName = new HashMap<String, IconMultiStateFormatting.IconSet>();\r
private IconSet(int id, int num, String name) {\r
this.id = id; this.num = num; this.name = name;\r
+ byId[id] = this;\r
+ byName.put(getName(),this);\r
}\r
}\r
/** Green Up / Yellow Side / Red Down arrows */\r
void setIconOnly(boolean only);\r
\r
boolean isReversed();\r
- void setReversed();\r
+ void setReversed(boolean reversed);\r
\r
// TODO States\r
}\r