当前位置: 首页>>代码示例>>Java>>正文


Java KeyDescriptor类代码示例

本文整理汇总了Java中com.intellij.util.io.KeyDescriptor的典型用法代码示例。如果您正苦于以下问题:Java KeyDescriptor类的具体用法?Java KeyDescriptor怎么用?Java KeyDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


KeyDescriptor类属于com.intellij.util.io包,在下文中一共展示了KeyDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ObjectObjectPersistentMultiMaplet

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public ObjectObjectPersistentMultiMaplet(final File file,
                                      final KeyDescriptor<K> keyExternalizer,
                                      final DataExternalizer<V> valueExternalizer,
                                      final CollectionFactory<V> collectionFactory) throws IOException {
  myValueExternalizer = valueExternalizer;
  myMap = new PersistentHashMap<K, Collection<V>>(file, keyExternalizer, new CollectionDataExternalizer<V>(valueExternalizer, collectionFactory));
  myCache = new SLRUCache<K, Collection>(CACHE_SIZE, CACHE_SIZE, keyExternalizer) {
    @NotNull
    @Override
    public Collection createValue(K key) {
      try {
        final Collection<V> collection = myMap.get(key);
        return collection == null? NULL_COLLECTION : collection;
      }
      catch (IOException e) {
        throw new BuildDataCorruptedException(e);
      }
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ObjectObjectPersistentMultiMaplet.java

示例2: IntIntPersistentMultiMaplet

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public IntIntPersistentMultiMaplet(final File file, final KeyDescriptor<Integer> keyExternalizer) throws IOException {
  myMap = new PersistentHashMap<Integer, TIntHashSet>(file, keyExternalizer, new IntSetExternalizer());
  myCache = new SLRUCache<Integer, TIntHashSet>(CACHE_SIZE, CACHE_SIZE) {
    @NotNull
    @Override
    public TIntHashSet createValue(Integer key) {
      try {
        final TIntHashSet collection = myMap.get(key);
        return collection == null? NULL_COLLECTION : collection;
      }
      catch (IOException e) {
        throw new BuildDataCorruptedException(e);
      }
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:IntIntPersistentMultiMaplet.java

示例3: IntObjectPersistentMultiMaplet

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public IntObjectPersistentMultiMaplet(final File file,
                                      final KeyDescriptor<Integer> keyExternalizer,
                                      final DataExternalizer<V> valueExternalizer,
                                      final CollectionFactory<V> collectionFactory) throws IOException {
  myValueExternalizer = valueExternalizer;
  myMap = new PersistentHashMap<Integer, Collection<V>>(file, keyExternalizer, new CollectionDataExternalizer<V>(valueExternalizer, collectionFactory));
  myCache = new SLRUCache<Integer, Collection>(CACHE_SIZE, CACHE_SIZE) {
    @NotNull
    @Override
    public Collection createValue(Integer key) {
      try {
        final Collection<V> collection = myMap.get(key);
        return collection == null? NULL_COLLECTION : collection;
      }
      catch (IOException e) {
        throw new BuildDataCorruptedException(e);
      }
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:IntObjectPersistentMultiMaplet.java

示例4: ObjectObjectPersistentMultiMaplet

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public ObjectObjectPersistentMultiMaplet(final File file,
                                      final KeyDescriptor<K> keyExternalizer,
                                      final DataExternalizer<V> valueExternalizer,
                                      final CollectionFactory<V> collectionFactory) throws IOException {
  myValueExternalizer = valueExternalizer;
  myMap = new PersistentHashMap<K, Collection<V>>(file, keyExternalizer, new CollectionDataExternalizer<V>(valueExternalizer, collectionFactory));
  myCache = new SLRUCache<K, Collection>(CACHE_SIZE, CACHE_SIZE) {
    @NotNull
    @Override
    public Collection createValue(K key) {
      try {
        final Collection<V> collection = myMap.get(key);
        return collection == null? NULL_COLLECTION : collection;
      }
      catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:ObjectObjectPersistentMultiMaplet.java

示例5: IntIntPersistentMultiMaplet

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public IntIntPersistentMultiMaplet(final File file, final KeyDescriptor<Integer> keyExternalizer) throws IOException {
  myMap = new PersistentHashMap<Integer, TIntHashSet>(file, keyExternalizer, new IntSetExternalizer());
  myCache = new SLRUCache<Integer, TIntHashSet>(CACHE_SIZE, CACHE_SIZE) {
    @NotNull
    @Override
    public TIntHashSet createValue(Integer key) {
      try {
        final TIntHashSet collection = myMap.get(key);
        return collection == null? NULL_COLLECTION : collection;
      }
      catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:IntIntPersistentMultiMaplet.java

示例6: IntObjectPersistentMultiMaplet

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public IntObjectPersistentMultiMaplet(final File file,
                                      final KeyDescriptor<Integer> keyExternalizer,
                                      final DataExternalizer<V> valueExternalizer,
                                      final CollectionFactory<V> collectionFactory) throws IOException {
  myValueExternalizer = valueExternalizer;
  myMap = new PersistentHashMap<Integer, Collection<V>>(file, keyExternalizer, new CollectionDataExternalizer<V>(valueExternalizer, collectionFactory));
  myCache = new SLRUCache<Integer, Collection>(CACHE_SIZE, CACHE_SIZE) {
    @NotNull
    @Override
    public Collection createValue(Integer key) {
      try {
        final Collection<V> collection = myMap.get(key);
        return collection == null? NULL_COLLECTION : collection;
      }
      catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:IntObjectPersistentMultiMaplet.java

示例7: getKeyDescriptor

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
@NotNull
@Override
public KeyDescriptor<ConfigIndexKey> getKeyDescriptor() {
  return new KeyDescriptor<ConfigIndexKey>() {
    @Override
    public int getHashCode(ConfigIndexKey configKey) {
      return configKey.hashCode();
    }

    @Override
    public boolean isEqual(ConfigIndexKey val1, ConfigIndexKey val2) {
      return val1.equals(val2);
    }

    @Override
    public void save(@NotNull DataOutput out, ConfigIndexKey value) throws IOException {
      out.writeUTF(StringUtil.notNullize(value.getDirectoryName()));
      out.writeUTF(StringUtil.notNullize(value.getConfigKey()));
    }

    @Override
    public ConfigIndexKey read(@NotNull DataInput in) throws IOException {
      return new ConfigIndexKey(in.readUTF(), in.readUTF());
    }
  };
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:27,代码来源:LombokConfigIndex.java

示例8: ClassFilesIndexStorageBase

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public ClassFilesIndexStorageBase(final File indexDir, final KeyDescriptor<K> keyDescriptor, final DataExternalizer<V> valueExternalizer)
  throws IOException {
  myIndexFile = getIndexFile(indexDir);
  myKeyDescriptor = keyDescriptor;
  myValueExternalizer = valueExternalizer;
  initialize();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ClassFilesIndexStorageBase.java

示例9: ClassFilesIndexStorageWriter

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public ClassFilesIndexStorageWriter(final File indexDir,
                                    final KeyDescriptor<K> keyDescriptor,
                                    final DataExternalizer<V> valueExternalizer,
                                    final Mappings mappings) throws IOException {
  super(indexDir, keyDescriptor, valueExternalizer);
  myMappings = mappings;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ClassFilesIndexStorageWriter.java

示例10: SmallMapSerializer

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public SmallMapSerializer(final File file, final KeyDescriptor<K> keyDescriptor, final DataExternalizer<V> valueExternalizer) {
  myFile = file;
  myKeyDescriptor = keyDescriptor;
  myValueExternalizer = valueExternalizer;
  myMap = new HashMap<KeyWrapper<K>, V>();
  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:SmallMapSerializer.java

示例11: ValueContainerMap

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
ValueContainerMap(@NotNull final File file,
                  @NotNull KeyDescriptor<Key> keyKeyDescriptor,
                  @NotNull DataExternalizer<Value> valueExternalizer,
                  boolean keyIsUniqueForIndexedFile
                  ) throws IOException {
  super(file, keyKeyDescriptor, new ValueContainerExternalizer<Value>(valueExternalizer));
  myValueExternalizer = valueExternalizer;
  myKeyIsUniqueForIndexedFile = keyIsUniqueForIndexedFile;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ValueContainerMap.java

示例12: IntIntPersistentMaplet

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public IntIntPersistentMaplet(final File file, final KeyDescriptor<Integer> k) {
  try {
    myMap = new PersistentHashMap<Integer, Integer>(file, k, new DataExternalizer<Integer>() {
      @Override
      public void save(DataOutput out, Integer value) throws IOException {
        out.writeInt(value);
      }

      @Override
      public Integer read(DataInput in) throws IOException {
        return in.readInt();
      }
    });
    myCache = new SLRUCache<Integer, Object>(CACHE_SIZE, CACHE_SIZE) {
      @NotNull
      @Override
      public Object createValue(Integer key) {
        try {
          final Integer v1 = myMap.get(key);
          return v1 == null? NULL_OBJ : v1;
        }
        catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
    };
  }
  catch (IOException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:IntIntPersistentMaplet.java

示例13: createDataExternalizer

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public static DataExternalizer<CallingLocation> createDataExternalizer() {
  final KeyDescriptor<MethodIncompleteSignature> methodIncompleteSignatureKeyDescriptor = MethodIncompleteSignature.createKeyDescriptor();
  return new DataExternalizer<CallingLocation>() {
    @Override
    public void save(final DataOutput out, final CallingLocation value) throws IOException {
      methodIncompleteSignatureKeyDescriptor.save(out, value.getMethodIncompleteSignature());
      VariableType.KEY_DESCRIPTOR.save(out, value.getVariableType());
    }

    @Override
    public CallingLocation read(final DataInput in) throws IOException {
      return new CallingLocation(methodIncompleteSignatureKeyDescriptor.read(in), VariableType.KEY_DESCRIPTOR.read(in));
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:CallingLocation.java

示例14: CachedPersistentHashMap

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public CachedPersistentHashMap(File file, KeyDescriptor<Key> keyDescriptor, DataExternalizer<Value> valDescriptor, final int cacheSize) throws IOException {
  super(file, keyDescriptor, valDescriptor);
  myCache = new SLRUMap<Key,Value>(cacheSize * 2, cacheSize) {
    protected void onDropFromCache(Key key, Value value) {
      if (isValueDirty(value)) {
        try {
          CachedPersistentHashMap.super.put(key, value);
        }
        catch (IOException e) {
          LOG.info(e);
        }
      }
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:CachedPersistentHashMap.java

示例15: MapIndexStorage

import com.intellij.util.io.KeyDescriptor; //导入依赖的package包/类
public MapIndexStorage(@NotNull File storageFile,
                       @NotNull KeyDescriptor<Key> keyDescriptor,
                       @NotNull DataExternalizer<Value> valueExternalizer,
                       final int cacheSize
) throws IOException {
  this(storageFile, keyDescriptor, valueExternalizer, cacheSize, false);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:MapIndexStorage.java


注:本文中的com.intellij.util.io.KeyDescriptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。