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


Java EnumeratorStringDescriptor类代码示例

本文整理汇总了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()));
        }
      });
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:TestStateStorage.java

示例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));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:SvnBranchPointsCalculator.java

示例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));
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:MethodShortSignature.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:TestStateStorage.java

示例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);
    }

}
 
开发者ID:cedricziel,项目名称:idea-php-typo3-plugin,代码行数:11,代码来源:StringSetDataExternalizer.java

示例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;
}
 
开发者ID:cedricziel,项目名称:idea-php-typo3-plugin,代码行数:10,代码来源:StringSetDataExternalizer.java

示例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);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:StateCache.java

示例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");
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:CompilerOutputIndexer.java

示例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);
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:StateCache.java

示例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());
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:GitCommitsSequentialIndex.java

示例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);
    }
}
 
开发者ID:Haehnchen,项目名称:idea-php-symfony2-plugin,代码行数:10,代码来源:StringSetDataExternalizer.java

示例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;
}
 
开发者ID:Haehnchen,项目名称:idea-php-symfony2-plugin,代码行数:10,代码来源:StringSetDataExternalizer.java

示例13: getKeyDescriptor

import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return new EnumeratorStringDescriptor();
}
 
开发者ID:cedricziel,项目名称:idea-php-typo3-plugin,代码行数:6,代码来源:ControllerActionIndex.java

示例14: getKeyDescriptor

import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return EnumeratorStringDescriptor.INSTANCE;
}
 
开发者ID:cedricziel,项目名称:idea-php-typo3-plugin,代码行数:6,代码来源:ResourcePathIndex.java

示例15: getValueExternalizer

import com.intellij.util.io.EnumeratorStringDescriptor; //导入依赖的package包/类
@NotNull
public DataExternalizer<String> getValueExternalizer() {
    return EnumeratorStringDescriptor.INSTANCE;
}
 
开发者ID:magento,项目名称:magento2-phpstorm-plugin,代码行数:5,代码来源:VirtualTypeIndex.java


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