public synchronized <M extends MVMap<K,V>,K,V>M openMap(String name,MVMap.MapBuilder<M,K,V> builder){
  checkOpen();
  String x=meta.get("name." + name);
  int id;
  long root;
  HashMap<String,Object> c;
  M map;
  if (x != null) {
    id=DataUtils.parseHexInt(x);
    @SuppressWarnings("unchecked") M old=(M)maps.get(id);
    if (old != null) {
      return old;
    }
    map=builder.create();
    String config=meta.get(MVMap.getMapKey(id));
    c=New.hashMap();
    c.putAll(DataUtils.parseMap(config));
    c.put("id",id);
    map.init(this,c);
    root=getRootPos(meta,id);
  }
 else {
    c=New.hashMap();
    id=++lastMapId;
    c.put("id",id);
    c.put("createVersion",currentVersion);
    map=builder.create();
    map.init(this,c);
    markMetaChanged();
    x=Integer.toHexString(id);
    meta.put(MVMap.getMapKey(id),map.asString(name));
    meta.put("name." + name,x);
    root=0;
  }
  map.setRootPos(root,-1);
  maps.put(id,map);
  return map;
}

public synchronized < M extends MVMap < K , V > , K , V > M openMap ( String name , MVMap . MapBuilder < M , K , V > builder ) { checkOpen ( ) ; String x = meta . get ( "name." + name ) ; int id ; long root ; HashMap < String , Object > c ; M map ; if ( x != null ) { id = DataUtils . parseHexInt ( x ) ; @ SuppressWarnings ( "unchecked" ) M old = ( M ) maps . get ( id ) ; if ( old != null ) { return old ; } map = builder . create ( ) ; String config = meta . get ( MVMap . getMapKey ( id ) ) ; c = New . hashMap ( ) ; c . putAll ( DataUtils . parseMap ( config ) ) ; c . put ( "id" , id ) ; map . init ( this , c ) ; root = getRootPos ( meta , id ) ; } else { c = New . hashMap ( ) ; id = ++ lastMapId ; c . put ( "id" , id ) ; c . put ( "createVersion" , currentVersion ) ; map = builder . create ( ) ; map . init ( this , c ) ; markMetaChanged ( ) ; x = Integer . toHexString ( id ) ; meta . put ( MVMap . getMapKey ( id ) , map . asString ( name ) ) ; meta . put ( "name." + name , x ) ; root = 0 ; } map . setRootPos ( root , - 1 ) ; maps . put ( id , map ) ; return map ; }
open a map with the given builder . the map is automatically create if it does not yet exist . if a map with this name is already open , this map is returned .
