當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。