Impl(Strategy<K,V,E> strategy,Builder builder){
  int concurrencyLevel=builder.getConcurrencyLevel();
  int initialCapacity=builder.getInitialCapacity();
  if (concurrencyLevel > MAX_SEGMENTS) {
    concurrencyLevel=MAX_SEGMENTS;
  }
  int segmentShift=0;
  int segmentCount=1;
  while (segmentCount < concurrencyLevel) {
    ++segmentShift;
    segmentCount<<=1;
  }
  this.segmentShift=32 - segmentShift;
  segmentMask=segmentCount - 1;
  this.segments=newSegmentArray(segmentCount);
  if (initialCapacity > MAXIMUM_CAPACITY) {
    initialCapacity=MAXIMUM_CAPACITY;
  }
  int segmentCapacity=initialCapacity / segmentCount;
  if (segmentCapacity * segmentCount < initialCapacity) {
    ++segmentCapacity;
  }
  int segmentSize=1;
  while (segmentSize < segmentCapacity) {
    segmentSize<<=1;
  }
  for (int i=0; i < this.segments.length; ++i) {
    this.segments[i]=new Segment(segmentSize);
  }
  this.strategy=strategy;
  strategy.setInternals(new InternalsImpl());
}

Impl ( Strategy < K , V , E > strategy , Builder builder ) { int concurrencyLevel = builder . getConcurrencyLevel ( ) ; int initialCapacity = builder . getInitialCapacity ( ) ; if ( concurrencyLevel > MAX_SEGMENTS ) { concurrencyLevel = MAX_SEGMENTS ; } int segmentShift = 0 ; int segmentCount = 1 ; while ( segmentCount < concurrencyLevel ) { ++ segmentShift ; segmentCount <<= 1 ; } this . segmentShift = 32 - segmentShift ; segmentMask = segmentCount - 1 ; this . segments = newSegmentArray ( segmentCount ) ; if ( initialCapacity > MAXIMUM_CAPACITY ) { initialCapacity = MAXIMUM_CAPACITY ; } int segmentCapacity = initialCapacity / segmentCount ; if ( segmentCapacity * segmentCount < initialCapacity ) { ++ segmentCapacity ; } int segmentSize = 1 ; while ( segmentSize < segmentCapacity ) { segmentSize <<= 1 ; } for ( int i = 0 ; i < this . segments . length ; ++ i ) { this . segments [ i ] = new Segment ( segmentSize ) ; } this . strategy = strategy ; strategy . setInternals ( new InternalsImpl ( ) ) ; }
creates a new , empty map with the specified strategy , initial capacity , load factor and concurrency level .
