Package com.google.common.collect

Examples of com.google.common.collect.MapMaker$StrategyImpl$Fields


    private final ReentrantReadWriteLock dumpLock;

    public CategoryMaskManager(ReentrantReadWriteLock dumpLock) {
        this.nextbit = new AtomicInteger(0);
        this.categoryInfoMap = new MapMaker().makeMap();
        this.dumpLock = dumpLock;
    }
View Full Code Here


  }

  @Test
  public void testWeakRefsMap() throws Exception {

    ConcurrentMap<String, Object> objects = new MapMaker().weakValues()
        .makeMap();

    objects.put("xxx", new Object());

    if (null == objects.get("xxx")) {
View Full Code Here

    @Inject StateCache(@SlobLocalCacheExpirationMillis int expirationMillis) {
      // See commit ebb4736368b6d371a1bf5005541d96b88dcac504 for my failed attempt
      // at using CacheBuilder.  TODO(ohler): Figure out the right solution to this.
      @SuppressWarnings("deprecation")
      Map<Pair<String, SlobId>, CacheEntry> currentStates = new MapMaker()
          .softValues()
          .expireAfterAccess(expirationMillis, TimeUnit.MILLISECONDS)
          .makeMap();
      this.currentStates = currentStates;
    }
View Full Code Here

    private static Set<Object> newStrongSet(final int expectedMaxSize) {
      return newSetFromMap(new IdentityHashMap<Object, Boolean>(expectedMaxSize));
    }

    private static Set<Object> newWeakSet() {
      return newSetFromMap(new MapMaker().concurrencyLevel(WRITE_CONCURRENCY).weakKeys().<Object, Boolean> makeMap());
    }
View Full Code Here

    private Integer _singleContextId;

    public ContextIdReference(final T reference, final ReferenceQueue<? super T> queue) {
        super(reference, queue);
        if (Constants.useMultipleContexts) {
            _idCache = new MapMaker().initialCapacity(2).weakKeys().makeMap();
        } else {
            _idCache = null;
        }
        REFS.add(this);
    }
View Full Code Here

        if (vboId == 0) {
            throw new IllegalArgumentException("vboId must != 0");
        }

        if (_vboIdCache == null) {
            _vboIdCache = new MapMaker().initialCapacity(1).weakKeys().makeMap();
        }
        _vboIdCache.put(glContext, vboId);
    }
View Full Code Here

    public void setRenderDelegate(final RenderDelegate delegate, final Object glContextRef) {
        if (_delegateMap == null) {
            if (delegate == null) {
                return;
            } else {
                _delegateMap = new MapMaker().weakKeys().makeMap();
            }
        }
        if (delegate != null) {
            if (glContextRef == null) {
                _delegateMap.put(defaultDelegateRef, delegate);
View Full Code Here

    protected Map<ClientIdentity, Position>                  cursors;

    public void start() {
        super.start();

        batches = new MapMaker().makeComputingMap(new Function<ClientIdentity, MemoryClientIdentityBatch>() {

            public MemoryClientIdentityBatch apply(ClientIdentity clientIdentity) {
                return MemoryClientIdentityBatch.create(clientIdentity);
            }

        });

        cursors = new MapMaker().makeMap();

        destinations = new MapMaker().makeComputingMap(new Function<String, List<ClientIdentity>>() {

            public List<ClientIdentity> apply(String destination) {
                return Lists.newArrayList();
            }
        });
View Full Code Here

    public Field$Reflection() {
        super(new ArrayList());
        List list = (List)target();
        for(int i = 0; i < 100; ++i) {
            Object o = new A100$Fields();
            fill(o);
            list.add(o);
        }
    }
View Full Code Here

    @Override
    protected List<ColumnDefinition> getElements0() throws SQLException {
        List<ColumnDefinition> result = new ArrayList<ColumnDefinition>();

        Rdb$relationFields r = RDB$RELATION_FIELDS.as("r");
        Rdb$fields f = RDB$FIELDS.as("f");

        // Inspiration for the below query was taken from jaybird's
        // DatabaseMetaData implementation
        for (Record record : create().select(
                r.RDB$FIELD_NAME.trim(),
View Full Code Here

TOP

Related Classes of com.google.common.collect.MapMaker$StrategyImpl$Fields

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.