Tabnine Logo
FilePathCache
Code IndexAdd Tabnine to your IDE (free)

How to use
FilePathCache
in
org.netbeans.modules.cnd.utils.cache

Best Java code snippets using org.netbeans.modules.cnd.utils.cache.FilePathCache (Showing top 20 results out of 315)

origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

public void fixFolder(CharSequence path){
  if (path != null) {
    projectRoots.put(FilePathCache.getManager().getString(path), Integer.MAX_VALUE / 2);
  }
}

origin: org.netbeans.modules/org-netbeans-modules-cnd-utils

public static List<CharSequence> asList(Collection<? extends CharSequence> paths) {
  List<CharSequence> out = new ArrayList<CharSequence>(paths.size());
  for (CharSequence path : paths) {
    out.add(FilePathCache.getManager().getString(path));
  }
  return out;
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

private void addPath(CharSequence path) {
  CharSequence parent = findParent(path);
  if (parent != null) {
    path = parent;
  }
  CharSequence added = FilePathCache.getManager().getString(path);
  Integer integer = projectRoots.get(added);
  if (integer == null) {
    projectRoots.put(added, 1);
  } else {
    projectRoots.put(added, integer + 1);
  }
}

origin: org.netbeans.modules/org-netbeans-modules-cnd-apt

  public APTIncludeResolverImpl(FileSystem fs, CharSequence path, int baseFileIncludeDirIndex,
                  List<IncludeDirEntry> systemIncludePaths,
                  List<IncludeDirEntry> userIncludePaths, APTFileSearch fileSearch) {
    this.fileSystem = fs;
    this.baseFile = FilePathCache.getManager().getString(path);
    this.systemIncludePaths = systemIncludePaths;
    this.userIncludePaths = userIncludePaths;
    //int aHashCode = 0;
    //if (APTTraceFlags.USE_INCLIDE_RESOLVER_CACHE) {
    //    for(IncludeDirEntry entry: systemIncludePaths) {
    //        aHashCode+=entry.hashCode()*31;
    //    }
    //    for(IncludeDirEntry entry: userIncludePaths) {
    //        aHashCode+=entry.hashCode()*19;
    //    }
    //}
    //hashCode = aHashCode;
    this.baseFileIncludeDirIndex = baseFileIncludeDirIndex;
    this.fileSearch = fileSearch;
//        if (TRACE) { 
//            System.err.printf("APTIncludeResolverImpl.ctor %s %s systemIncludePaths: %s\n", fileSystem, path, systemIncludePaths); // NOI18N
//        }
  }       

origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

private CharSequence getCanonicalKey(CharSequence fileKey) {
  try {
    CharSequence res = CndFileSystemProvider.getCanonicalPath(fileSystem, fileKey);
    res = FilePathCache.getManager().getString(res);
    if (fileKey.equals(res)) {
      return fileKey;
    }
    return res;
  } catch (IOException e) {
    // skip exception
    return fileKey;
  }
}

origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

private static CharSequence getCanonicalKey(FileObject fileObject, CharSequence fileKey) {
  try {
    CharSequence res = CndFileUtils.getCanonicalPath(fileObject);
    res = FilePathCache.getManager().getString(res);
    if (fileKey.equals(res)) {
      return fileKey;
    }
    return res;
  } catch (IOException e) {
    // skip exception
    return fileKey;
  }
}

origin: org.netbeans.modules/org-netbeans-modules-cnd-apt

public StartEntry(FileSystem fs, String startFile, Key startFileProject) {
  Parameters.notNull("startFileProject", startFileProject); //NOI18N
  this.fileSystem = fs;
  this.startFile = FilePathCache.getManager().getString(startFile);
  this.startFileProject = startFileProject;
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

private LibProjectImpl(ModelImpl model, FileSystem fs, CharSequence includePathName, int sourceUnitId) {
  super(model, fs, includePathName, includePathName, sourceUnitId);
  this.includePath = FilePathCache.getManager().getString(includePathName);
  this.projectRoots.fixFolder(includePathName);
  assert this.includePath != null;
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

FileBufferImpl(FileSystem fileSystem, CharSequence absPath, FileImpl fileImpl) {
  this.absPath = FilePathCache.getManager().getString(absPath);
  this.fileSystem = fileSystem;
  this.fileImpl = fileImpl;
  this.bufType = (fileImpl.getFileType() == FileImpl.FileType.HEADER_FILE) ? APTFileBuffer.BufferType.INCLUDED : APTFileBuffer.BufferType.START_FILE;
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-apt

/*package*/static void invalidateFileBasedCache(String file) {
  final CharSequence key = FilePathCache.getManager().getString(file);
  Map<CharSequence, IncludeDirEntry> delegate = storage.getDelegate(key);
  synchronized (delegate) {
    IncludeDirEntry prev = delegate.remove(key);
    if (prev != null) {
      prev.invalidateDirExistence();
    }
  }
  ResolverResultsCache.clearCache();
}

origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

/*package*/ static void  readStringToFileEntryMap(
    FileSystem fs, int unitIndex,
    RepositoryDataInput input, Map<CharSequence, FileEntry> aMap) throws IOException {
  
  assert input != null; 
  assert aMap != null;
  
  final APTStringManager pathManager = FilePathCache.getManager();
  
  aMap.clear();
  final int size = input.readInt();
  
  for (int i = 0; i < size; i++) {
    CharSequence key = PersistentUtils.readFileNameIndex(input, pathManager, unitIndex);
    FileEntry value = new FileEntry(fs, input, unitIndex);
    
    assert key != null;
    assert value != null;
    
    aMap.put(key, value);
  }
}

origin: org.netbeans.modules/org-netbeans-modules-cnd-apt

public StartEntry(FileSystem fs, RepositoryDataInput input, int unitIndex) throws IOException {
  assert input != null;
  fileSystem = fs;
  startFileProject = KeyFactory.getDefaultFactory().readKey(input);
  startFile = APTSerializeUtils.readFileNameIndex(input, FilePathCache.getManager(), unitIndex);
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

  public LibProjectImpl(RepositoryDataInput aStream) throws IOException {
    super(aStream);
    this.includePath = APTSerializeUtils.readFileNameIndex(aStream, FilePathCache.getManager(), getUnitId());
    assert this.includePath != null;
    setPlatformProject(this.includePath);
  }
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

public static CharSequence getFileKey(CharSequence file, boolean sharedText) {
  return sharedText ? FilePathCache.getManager().getString(file) : DefaultCache.getManager().getString(file);
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

protected AbstractFileBuffer(RepositoryDataInput input, int unitId) throws IOException {
  this.absPath = APTSerializeUtils.readFileNameIndex(input, FilePathCache.getManager(), unitId);
  this.fileSystem = PersistentUtils.readFileSystem(input);
  assert this.absPath != null;
  fileObject = new WeakReference<>(null);
  bufType = BufferType.values()[input.readByte()];
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

  protected AbstractFileBuffer(FileObject fileObject) {
    this.absPath = FilePathCache.getManager().getString(CndFileUtils.normalizePath(fileObject));
    assert this.absPath != null : "no path for " + fileObject;
    this.fileSystem = getFileSystem(fileObject);
    this.fileObject = new WeakReference<>(fileObject);
    this.bufType = MIMENames.isCppOrCOrFortran(fileObject.getMIMEType()) ? APTFileBuffer.BufferType.START_FILE : APTFileBuffer.BufferType.INCLUDED;
// remote link file objects are just lightweight delegating wrappers, so they have multiple instances
//        if (CndUtils.isDebugMode()) {
//            FileObject fo2 = fileSystem.findResource(absPath.toString());
//            CndUtils.assertTrue(fileObject == fo2, "File objects differ: " + fileObject + " vs " + fo2); //NOI18N
//        }
  }

origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

private static void readStringToStringsArrMap(
    final int unitId, final RepositoryDataInput input, Map<CharSequence,
        Object/*CharSequence or CharSequence[]*/> aMap) throws IOException {
  assert input != null;
  assert aMap != null;
  final APTStringManager pathManager = FilePathCache.getManager();
  aMap.clear();
  final int size = input.readInt();
  for (int i = 0; i < size; i++) {
    CharSequence key = APTSerializeUtils.readFileNameIndex(input, pathManager, unitId);
    assert key != null;
    final int arraySize = input.readInt();
    assert arraySize != 0;
    if (arraySize == 1) {
      aMap.put(key, APTSerializeUtils.readFileNameIndex(input, pathManager, unitId));
    } else {
      final CharSequence[] value = new CharSequence[arraySize];
      for (int j = 0; j < arraySize; j++) {
        CharSequence path = APTSerializeUtils.readFileNameIndex(input, pathManager, unitId);
        assert path != null;
        value[j] = path;
      }
      aMap.put(key, value);
    }
  }
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-apt

/** Creates a new instance of APTFileNode */
public APTFileNode(FileSystem fileSystem, CharSequence path) {
  Parameters.notNull("null fileSystem", fileSystem); //NOI18N
  this.fileSystem = fileSystem;
  this.path = FilePathCache.getManager().getString(path);
  this.guard = TextCache.getManager().getString(guard);
  tokenized = true;
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-apt

public ResolvedPath(FileSystem fileSystem, CharSequence folder, CharSequence path, boolean isDefaultSearchPath, int index) {
  this.folder = folder;// should be already shared
  this.fileSystem = fileSystem;
  this.path = FilePathCache.getManager().getString(path);
  this.isDefaultSearchPath = isDefaultSearchPath;
  this.index = index;
origin: org.netbeans.modules/org-netbeans-modules-cnd-apt

public IncludeInfoImpl(final RepositoryDataInput input, int unitIndex) throws IOException {
  assert input != null;
  this.path = APTSerializeUtils.readFileNameIndex(input, FilePathCache.getManager(), unitIndex);
  directiveLine = input.readInt();
  directiveOffset = input.readInt();
  resolvedDirIndex = input.readInt();
}
org.netbeans.modules.cnd.utils.cacheFilePathCache

Javadoc

cache entry

Most used methods

  • getManager

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • onRequestPermissionsResult (Fragment)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Collectors (java.util.stream)
  • JButton (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now