com.intellij.util.io.KeyDescriptor Java Examples

The following examples show how to use com.intellij.util.io.KeyDescriptor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LombokConfigIndex.java    From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@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());
    }
  };
}
 
Example #2
Source File: ValueContainerMap.java    From consulo with Apache License 2.0 5 votes vote down vote up
ValueContainerMap(@Nonnull final File file,
                  @Nonnull KeyDescriptor<Key> keyKeyDescriptor,
                  @Nonnull DataExternalizer<Value> valueExternalizer,
                  boolean keyIsUniqueForIndexedFile,
                  @Nonnull IntIntFunction inputRemapping) throws IOException {
  super(file, keyKeyDescriptor, new ValueContainerExternalizer<>(valueExternalizer, inputRemapping));
  myValueExternalizer = valueExternalizer;
  myKeyIsUniqueForIndexedFile = keyIsUniqueForIndexedFile;
}
 
Example #3
Source File: SmallMapSerializer.java    From consulo with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example #4
Source File: StubProvidedIndexExtension.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nullable
public <K> ProvidedIndexExtension<K, Void> findProvidedStubIndex(@Nonnull StubIndexExtension<K, ?> extension) {
  String name = extension.getKey().getName();
  File path = getIndexPath();

  File indexPath = new File(path, StringUtil.toLowerCase(name));
  if (!indexPath.exists()) return null;

  return new ProvidedIndexExtension<K, Void>() {
    @Nonnull
    @Override
    public File getIndexPath() {
      return myIndexFile;
    }

    @Nonnull
    @Override
    public ID<K, Void> getIndexId() {
      return (ID)extension.getKey();
    }

    @Nonnull
    @Override
    public KeyDescriptor<K> createKeyDescriptor() {
      return extension.getKeyDescriptor();
    }

    @Nonnull
    @Override
    public DataExternalizer<Void> createValueExternalizer() {
      return VoidDataExternalizer.INSTANCE;
    }
  };
}
 
Example #5
Source File: AnnotationUsageIndex.java    From idea-php-annotation-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return this.myKeyDescriptor;
}
 
Example #6
Source File: StubIndexExtension.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
KeyDescriptor<Key> getKeyDescriptor();
 
Example #7
Source File: StubProvidedIndexExtension.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public KeyDescriptor<Integer> createKeyDescriptor() {
  return EnumeratorIntegerDescriptor.INSTANCE;
}
 
Example #8
Source File: ContainerParameterStubIndex.java    From idea-php-symfony2-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return this.myKeyDescriptor;
}
 
Example #9
Source File: TrigramIndex.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public KeyDescriptor<Integer> getKeyDescriptor() {
  return EnumeratorIntegerDescriptor.INSTANCE;
}
 
Example #10
Source File: PersistentSetImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
public PersistentSetImpl(@Nonnull File file,
                         @Nonnull KeyDescriptor<T> dataDescriptor,
                         int initialSize,
                         @Nullable PagedFileStorage.StorageLockContext lockContext, int version) throws IOException {
  super(file, dataDescriptor, initialSize, lockContext, version);
}
 
Example #11
Source File: EventAnnotationStubIndex.java    From idea-php-symfony2-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return this.myKeyDescriptor;
}
 
Example #12
Source File: TwigMacroFunctionStubIndex.java    From idea-php-symfony2-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return this.myKeyDescriptor;
}
 
Example #13
Source File: HaxeComponentIndex.java    From intellij-haxe with Apache License 2.0 4 votes vote down vote up
@Override
public KeyDescriptor<String> getKeyDescriptor() {
  return new EnumeratorStringDescriptor();
}
 
Example #14
Source File: GenericCompiler.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
public abstract KeyDescriptor<Key> getItemKeyDescriptor();
 
Example #15
Source File: HaxeSymbolIndex.java    From intellij-haxe with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
  return new EnumeratorStringDescriptor();
}
 
Example #16
Source File: AbstractIgnoreFilesIndex.java    From idea-gitignore with MIT License 4 votes vote down vote up
/**
 * Returns {@link KeyDescriptor} implementation.
 *
 * @return {@link KeyDescriptor} instance.
 */
@NotNull
@Override
public KeyDescriptor<K> getKeyDescriptor() {
    return this;
}
 
Example #17
Source File: VfsDependentEnum.java    From consulo with Apache License 2.0 4 votes vote down vote up
public VfsDependentEnum(@Nonnull String fileName, @Nonnull KeyDescriptor<T> descriptor, int version) {
  myFile = new File(FSRecords.basePath(), DEPENDENT_PERSISTENT_LIST_START_PREFIX + fileName + FSRecords.VFS_FILES_EXTENSION);
  myKeyDescriptor = descriptor;
  myVersion = version;
}
 
Example #18
Source File: ConfigSchemaIndex.java    From idea-php-drupal-symfony2-bridge with MIT License 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return this.myKeyDescriptor;
}
 
Example #19
Source File: IdIndex.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public KeyDescriptor<IdIndexEntry> getKeyDescriptor() {
  return myKeyDescriptor;
}
 
Example #20
Source File: ConfigEntityTypeAnnotationIndex.java    From idea-php-drupal-symfony2-bridge with MIT License 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return this.myKeyDescriptor;
}
 
Example #21
Source File: KeyCollectionForwardIndexAccessor.java    From consulo with Apache License 2.0 4 votes vote down vote up
public KeyCollectionForwardIndexAccessor(@Nonnull KeyDescriptor<Key> externalizer, @Nonnull IndexId<Key, Value> indexId) {
  super(new InputIndexDataExternalizer<>(externalizer, indexId));
}
 
Example #22
Source File: GetTextFileIndex.java    From idea-php-drupal-symfony2-bridge with MIT License 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return this.myKeyDescriptor;
}
 
Example #23
Source File: LatteIndexExtension.java    From intellij-latte with MIT License 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return KEY_DESCRIPTOR;
}
 
Example #24
Source File: VcsLogFullDetailsIndex.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public KeyDescriptor<Integer> getKeyDescriptor() {
  return EnumeratorIntegerDescriptor.INSTANCE;
}
 
Example #25
Source File: Unity3dMetaIndexExtension.java    From consulo-unity3d with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public KeyDescriptor<String> getKeyDescriptor()
{
	return myKeyDescriptor;
}
 
Example #26
Source File: StringStubIndexExtension.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
public KeyDescriptor<String> getKeyDescriptor() {
  return new EnumeratorStringDescriptor();
}
 
Example #27
Source File: PantsAddressesIndex.java    From intellij-pants-plugin with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
  return new EnumeratorStringDescriptor();
}
 
Example #28
Source File: PantsTargetIndex.java    From intellij-pants-plugin with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
  return new EnumeratorStringDescriptor();
}
 
Example #29
Source File: InitResourceServiceIndex.java    From idea-php-shopware-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return this.myKeyDescriptor;
}
 
Example #30
Source File: SmartyBlockStubIndex.java    From idea-php-shopware-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public KeyDescriptor<String> getKeyDescriptor() {
    return this.myKeyDescriptor;
}