Exemplo n.º 1
0
 @Override
 public LayoutMapConfig clone() throws CloneNotSupportedException {
   LayoutMapConfig clone = (LayoutMapConfig) super.clone();
   clone.attrIds = (TIntArrayList) attrIds.clone();
   clone.constraintMapConfig = constraintMapConfig == null ? null : constraintMapConfig.clone();
   clone.indicesPlusOne = (TIntArrayList) indicesPlusOne.clone();
   clone.key = key;
   clone.lengths = (TIntArrayList) lengths.clone();
   clone.nextFloatsIndex = nextFloatsIndex;
   clone.nextIntsIndex = nextIntsIndex;
   return clone;
 }
Exemplo n.º 2
0
 /**
  * Get instance of AttrDefinitionMgr from store, or create one in the store if one didn't exist
  */
 private static LayoutMapConfig getFromStore() {
   LayoutMapConfig config = null;
   try {
     SimpleDAO dao = getConfigDAOClass().newInstance();
     dao.begin();
     config = dao.retrieve(LayoutMapConfig.class, ATTRIBUTE_KEY);
     if (config == null) {
       config = new LayoutMapConfig();
       config.key = ATTRIBUTE_KEY;
       config.constraintMapConfig = new LayoutMapConfig();
       config.constraintMapConfig.key = CONSTRAINT_KEY;
       config.ref = dao.create(config, ATTRIBUTE_KEY);
       dao.commit();
     }
   } catch (Exception e) {
     throw new RuntimeException(e); // FIXME: not sure what we'll get
   }
   return config;
 }