コード例 #1
0
ファイル: StockItem.java プロジェクト: JRsz/dtlTraders
 /**
  * Looks for the flag declaration that has the specified <b>key</b>. If found it will add it
  * automatically to the items structure.
  *
  * @param key the unique flag key
  */
 public void addFlag(String key) {
   try {
     ItemFlag flag = ItemFlag.initFlag(this, key);
     flags.put(flag.getClass(), flag);
   } catch (Exception e) {
     debugMsgClass(key);
   }
 }
コード例 #2
0
ファイル: StockItem.java プロジェクト: JRsz/dtlTraders
 /**
  * Looks for the attribute declaration that has the specified <b>key</b>. If found it will add it
  * automatically to the items structure and initialize with the given value.
  *
  * @param key the unique attribute key
  * @param value the value to initialize with
  */
 @SuppressWarnings("null")
 public void addAttr(String key, String value) {
   ItemAttr itemAttr = null;
   try {
     itemAttr = ItemAttr.initAttribute(this, key, value);
     if (itemAttr != null) this.attr.put(itemAttr.getClass(), itemAttr);
     else {
       // debug message that this key does not exists
       dB.high("The given key is not registered, skipping...");
       dB.high("key: ", key);
     }
   } catch (AttributeInvalidClassException e) {
     debugMsgClass(key);
   } catch (AttributeInvalidValueException e) {
     debugMsgValue(itemAttr.getInfo(), value);
   }
 }