Java 类com.intellij.util.io.EnumeratorStringDescriptor 实例源码

项目:intellij-ce-playground    文件:TestStateStorage.java   
@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()));
        }
      });
    }
  };
}
项目:intellij-ce-playground    文件:SvnBranchPointsCalculator.java   
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));
  }
}
项目:tools-idea    文件:MethodShortSignature.java   
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));
    }
  };
}
项目:tools-idea    文件:SvnBranchPointsCalculator.java   
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));
  }
}
项目:consulo    文件:TestStateStorage.java   
@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);
}
项目:idea-php-typo3-plugin    文件:StringSetDataExternalizer.java   
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);
    }

}
项目:idea-php-typo3-plugin    文件:StringSetDataExternalizer.java   
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;
}
项目:intellij-ce-playground    文件:StateCache.java   
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);
    }
  });
}
项目:tools-idea    文件:CompilerOutputIndexer.java   
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");
}
项目:tools-idea    文件:StateCache.java   
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);
    }
  });
}
项目:tools-idea    文件:GitCommitsSequentialIndex.java   
public void activate() {
  synchronized (myLock) {
    if (myState == null) {
      myState = new SmallMapSerializer<String, String>(myListFile, new EnumeratorStringDescriptor(), createExternalizer());
    }
  }
}
项目:idea-php-symfony2-plugin    文件:StringSetDataExternalizer.java   
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);
    }
}
项目:idea-php-symfony2-plugin    文件:StringSetDataExternalizer.java   
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;
}
项目:idea-php-annotation-plugin    文件:AnnotationUsageIndex.java   
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);
    }
}
项目:idea-php-annotation-plugin    文件:AnnotationUsageIndex.java   
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;
}
项目:idea-php-typo3-plugin    文件:ControllerActionIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return new EnumeratorStringDescriptor();
}
项目:idea-php-typo3-plugin    文件:ResourcePathIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return EnumeratorStringDescriptor.INSTANCE;
}
项目:idea-php-typo3-plugin    文件:RouteIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return new EnumeratorStringDescriptor();
}
项目:idea-php-typo3-plugin    文件:TranslationIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return EnumeratorStringDescriptor.INSTANCE;
}
项目:idea-php-typo3-plugin    文件:IconIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return EnumeratorStringDescriptor.INSTANCE;
}
项目:idea-php-typo3-plugin    文件:TablenameFileIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return EnumeratorStringDescriptor.INSTANCE;
}
项目:magento2-phpstorm-plugin    文件:VirtualTypeIndex.java   
@NotNull
public DataExternalizer<String> getValueExternalizer() {
    return EnumeratorStringDescriptor.INSTANCE;
}
项目:magento2-phpstorm-plugin    文件:ModulePackageIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return new EnumeratorStringDescriptor();
}
项目:magento2-phpstorm-plugin    文件:ModuleNameIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return new EnumeratorStringDescriptor();
}
项目:magento2-phpstorm-plugin    文件:ModuleNameIndex.java   
@NotNull
public DataExternalizer<String> getValueExternalizer() {
    return EnumeratorStringDescriptor.INSTANCE;
}
项目:intellij-neos    文件:StringDataExternalizer.java   
public synchronized void save(@NotNull DataOutput out, String value) throws IOException {
    EnumeratorStringDescriptor.INSTANCE.save(out, value);
}
项目:intellij-neos    文件:StringDataExternalizer.java   
public synchronized String read(@NotNull DataInput in) throws IOException {
    return EnumeratorStringDescriptor.INSTANCE.read(in);
}
项目:intellij-swagger    文件:OpenApiFileIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return EnumeratorStringDescriptor.INSTANCE;
}
项目:intellij-swagger    文件:SwaggerFileIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return EnumeratorStringDescriptor.INSTANCE;
}
项目:intellij-ce-playground    文件:JavaFunctionalExpressionIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
  return EnumeratorStringDescriptor.INSTANCE;
}
项目:intellij-ce-playground    文件:StringStubIndexExtension.java   
@NotNull
public KeyDescriptor<String> getKeyDescriptor() {
  return new EnumeratorStringDescriptor();
}
项目:intellij-ce-playground    文件:DomFileIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
  return new EnumeratorStringDescriptor();
}
项目:intellij-ce-playground    文件:Html5CustomAttributesIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
  return new EnumeratorStringDescriptor();
}
项目:intellij-ce-playground    文件:RelaxSymbolIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
  return new EnumeratorStringDescriptor();
}
项目:intellij-ce-playground    文件:AndroidAptStateStorage.java   
private AndroidAptStateStorage(@NotNull File dataStorageRoot) throws IOException {
  super(AndroidJpsUtil.getStorageFile(dataStorageRoot, RESOURCE_NAMES_STORAGE), new EnumeratorStringDescriptor(), new MyDataExternalizer());
}
项目:intellij-ce-playground    文件:AndroidBuildConfigStateStorage.java   
private AndroidBuildConfigStateStorage(@NotNull File dataStorageRoot) throws IOException {
  super(AndroidJpsUtil.getStorageFile(dataStorageRoot, BUILD_CONFIG_STORAGE), new EnumeratorStringDescriptor(), new MyDataExternalizer());
}
项目:intellij-ce-playground    文件:AndroidApkBuilderConfigStateStorage.java   
private AndroidApkBuilderConfigStateStorage(@NotNull File dataStorageRoot, @NotNull String storageName) throws IOException {
  super(AndroidJpsUtil.getStorageFile(dataStorageRoot, storageName), new EnumeratorStringDescriptor(), new MyDataExternalizer());
}
项目:intellij-ce-playground    文件:AndroidIdIndex.java   
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
  return new EnumeratorStringDescriptor();
}
项目:intellij-ce-playground    文件:MavenIndex.java   
private PersistentHashMap<String, Set<String>> createPersistentMap(final File f) throws IOException {
  return new PersistentHashMap<String, Set<String>>(f, new EnumeratorStringDescriptor(), new SetDescriptor());
}
项目:intellij-ce-playground    文件:SvnLoadedBranchesStorage.java   
public void activate() {
  synchronized (myLock) {
    myState = new SmallMapSerializer<String, Map<String, Collection<SvnBranchItem>>>(myFile, new EnumeratorStringDescriptor(), createExternalizer());
  }
}