* @param traitCode the trait key
* @param prop the value of the trait
*/
- public void addTrait(Object traitCode, Object prop) {
+ public void addTrait(Integer traitCode, Object prop) {
- if (props == null) {
- props = new java.util.HashMap<Integer, Object>(20);
+ if (traits == null) {
+ traits = new java.util.HashMap<Integer, Object>(20);
+ }
- traits.put((Integer) traitCode, prop);
++ traits.put(traitCode, prop);
+ }
+
+ /**
+ * Set traits on this area, copying from an existing traits map.
+ *
+ * @param traits the map of traits
+ */
+ public void setTraits ( Map traits ) {
+ if ( traits != null ) {
+ this.traits = new java.util.HashMap ( traits );
+ } else {
+ this.traits = null;
}
- props.put(traitCode, prop);
}
/**