本文整理汇总了Java中com.intellij.util.io.EnumeratorStringDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java EnumeratorStringDescriptor类的具体用法?Java EnumeratorStringDescriptor怎么用?Java EnumeratorStringDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EnumeratorStringDescriptor类属于com.intellij.util.io包,在下文中一共展示了EnumeratorStringDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getComputable
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
@NotNull
private static ThrowableComputable<PersistentHashMap<String, Record>, IOException> getComputable(final File file) {
return new ThrowableComputable<PersistentHashMap<String, Record>, IOException>() {
@Override
public PersistentHashMap<String, Record> compute() throws IOException {
return new PersistentHashMap<String, Record>(file, new EnumeratorStringDescriptor(), new DataExternalizer<Record>() {
@Override
public void save(@NotNull DataOutput out, Record value) throws IOException {
out.writeInt(value.magnitude);
out.writeLong(value.date.getTime());
}
@Override
public Record read(@NotNull DataInput in) throws IOException {
return new Record(in.readInt(), new Date(in.readLong()));
}
});
}
};
}
示例2: PersistentHolder
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
PersistentHolder(final File file) {
myLock = new Object();
myPersistentMap = new SmallMapSerializer<String, TreeMap<String, BranchCopyData>>(
file, new EnumeratorStringDescriptor(), new BranchDataExternalizer());
// list for values by default
myForSearchMap = new MultiMap<String, String>();
for (String s : myPersistentMap.keySet()) {
final TreeMap<String, BranchCopyData> map = myPersistentMap.get(s);
if (map != null) {
myForSearchMap.put(s, new ArrayList<String>(map.keySet()));
}
}
for (String key : myForSearchMap.keySet()) {
Collections.sort((List<String>) myForSearchMap.get(key));
}
}
示例3: createDataExternalizer
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
public static DataExternalizer<MethodShortSignature> createDataExternalizer() {
final EnumeratorStringDescriptor stringDescriptor = new EnumeratorStringDescriptor();
return new DataExternalizer<MethodShortSignature>() {
@Override
public void save(final DataOutput out, final MethodShortSignature value) throws IOException {
stringDescriptor.save(out, value.getName());
stringDescriptor.save(out, value.getSignature());
}
@Override
public MethodShortSignature read(final DataInput in) throws IOException {
return new MethodShortSignature(stringDescriptor.read(in), stringDescriptor.read(in));
}
};
}
示例4: getComputable
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
@Nonnull
private static ThrowableComputable<PersistentHashMap<String, Record>, IOException> getComputable(final File file) {
return () -> new PersistentHashMap<>(file, EnumeratorStringDescriptor.INSTANCE, new DataExternalizer<Record>() {
@Override
public void save(@Nonnull DataOutput out, Record value) throws IOException {
out.writeInt(value.magnitude);
out.writeLong(value.date.getTime());
out.writeLong(value.configurationHash);
}
@Override
public Record read(@Nonnull DataInput in) throws IOException {
return new Record(in.readInt(), new Date(in.readLong()), in.readLong());
}
}, 4096, CURRENT_VERSION);
}
示例5: save
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
public synchronized void save(@NotNull DataOutput out, Set<String> value) throws IOException {
out.writeInt(value.size());
Iterator var3 = value.iterator();
while(var3.hasNext()) {
String s = (String)var3.next();
EnumeratorStringDescriptor.INSTANCE.save(out, s);
}
}
示例6: read
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
public synchronized Set<String> read(@NotNull DataInput in) throws IOException {
THashSet set = new THashSet();
for(int r = in.readInt(); r > 0; --r) {
set.add(EnumeratorStringDescriptor.INSTANCE.read(in));
}
return set;
}
示例7: createMap
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
private PersistentHashMap<String, T> createMap(final File file) throws IOException {
return new PersistentHashMap<String,T>(file, new EnumeratorStringDescriptor(), new DataExternalizer<T>() {
public void save(@NotNull final DataOutput out, final T value) throws IOException {
StateCache.this.write(value, out);
}
public T read(@NotNull final DataInput in) throws IOException {
return StateCache.this.read(in);
}
});
}
示例8: initTimestampIndex
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
private void initTimestampIndex(final boolean needReindex) {
if (needReindex) {
FileUtil.delete(IndexInfrastructure.getIndexRootDir(getFileTimestampsIndexId()));
}
for (int attempts = 0; attempts < 2; attempts++) {
try {
myFileTimestampsIndex = new PersistentHashMap<String, Long>(IndexInfrastructure.getStorageFile(getFileTimestampsIndexId()),
new EnumeratorStringDescriptor(), new DataExternalizer<Long>() {
@Override
public void save(final DataOutput out, final Long value) throws IOException {
out.writeLong(value);
}
@Override
public Long read(final DataInput in) throws IOException {
return in.readLong();
}
});
}
catch (IOException e) {
FileUtil.delete(IndexInfrastructure.getIndexRootDir(getFileTimestampsIndexId()));
}
if (myFileTimestampsIndex != null) {
return;
}
}
throw new RuntimeException("Timestamps index not initialized");
}
示例9: createMap
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
private PersistentHashMap<String, T> createMap(final File file) throws IOException {
return new PersistentHashMap<String,T>(file, new EnumeratorStringDescriptor(), new DataExternalizer<T>() {
public void save(final DataOutput out, final T value) throws IOException {
StateCache.this.write(value, out);
}
public T read(final DataInput in) throws IOException {
return StateCache.this.read(in);
}
});
}
示例10: activate
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
public void activate() {
synchronized (myLock) {
if (myState == null) {
myState = new SmallMapSerializer<String, String>(myListFile, new EnumeratorStringDescriptor(), createExternalizer());
}
}
}
示例11: save
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
public synchronized void save(@NotNull DataOutput out, Set<String> value) throws IOException {
out.writeInt(value.size());
Iterator var = value.iterator();
while(var.hasNext()) {
String s = (String)var.next();
EnumeratorStringDescriptor.INSTANCE.save(out, s);
}
}
示例12: read
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
public synchronized Set<String> read(@NotNull DataInput in) throws IOException {
Set<String> set = new THashSet<>();
for(int r = in.readInt(); r > 0; --r) {
set.add(EnumeratorStringDescriptor.INSTANCE.read(in));
}
return set;
}
示例13: getKeyDescriptor
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
return new EnumeratorStringDescriptor();
}
示例14: getKeyDescriptor
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
return EnumeratorStringDescriptor.INSTANCE;
}
示例15: getValueExternalizer
import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
@NotNull
public DataExternalizer<String> getValueExternalizer() {
return EnumeratorStringDescriptor.INSTANCE;
}