示例#1
0
文件: BioSet.java 项目: kidaa/pcgen
 public AgeSet addToAgeMap(String regionName, AgeSet ageSet, URI sourceURI) {
   AgeSet old = ageMap.get(Region.getConstant(regionName), ageSet.getIndex());
   if (old != null) {
     if (ageSet.hasBonuses()
         || !ageSet.getKits().isEmpty()
         || !ageSet.getName().equals(old.getName())) {
       Logging.errorPrint(
           "Found second (non-identical) AGESET "
               + "in Bio Settings "
               + sourceURI
               + " for Region: "
               + regionName
               + " Index: "
               + ageSet.getIndex()
               + " using the existing "
               + old.getLSTformat());
     }
     return old;
   }
   ageMap.put(Region.getConstant(regionName), ageSet.getIndex(), ageSet);
   return ageSet;
 }
示例#2
0
 /**
  * Adds the given value to the List for the given ListKey. The null value cannot be used as a key
  * in a MapKeyMap. This method will automatically initialize the map for the given primary key if
  * there is not already a Map for that primary key.
  *
  * <p>This method is reference-semantic and this MapKeyMap will maintain a strong reference to
  * both the key object and the value object given as arguments to this method.
  *
  * @param key1 The MapKey indicating which Map the given object should be added to.
  * @param value The value to be added to the List for the given key.
  */
 public <K, V> V addToMapFor(MapKey<K, V> key1, K key2, V value) {
   return (V) map.put(key1, key2, value);
 }