Package org.python.pydev.core.cache

Examples of org.python.pydev.core.cache.CompleteIndexKey


        ArrayList<ModulesKey> newKeys = new ArrayList<ModulesKey>();
        ArrayList<ModulesKey> removedKeys = new ArrayList<ModulesKey>();

        //temporary
        CompleteIndexKey tempKey = new CompleteIndexKey((ModulesKey) null);

        Iterator<ModulesKey> it = keysFound.values().iterator();
        while (it.hasNext()) {
            ModulesKey next = it.next();
            if (next.file != null) {
                long lastModified = next.file.lastModified();
                if (lastModified != 0) {
                    tempKey.key = next;
                    CompleteIndexKey completeIndexKey = keys.get(tempKey);
                    boolean canAddAstInfoFor = PythonPathHelper.canAddAstInfoFor(next);
                    if (completeIndexKey == null) {
                        if (canAddAstInfoFor) {
                            newKeys.add(next);
                        }
                    } else {
                        if (canAddAstInfoFor) {
                            if (completeIndexKey.lastModified != lastModified) {
                                //Just re-add it if the time changed!
                                newKeys.add(next);
                            }
                        } else {
                            //It's there but it's not valid: Remove it!
                            removedKeys.add(next);
                        }
                    }
                }
            }
        }

        Iterator<CompleteIndexKey> it2 = keys.values().iterator();
        while (it2.hasNext()) {
            CompleteIndexKey next = it2.next();
            if (!keysFound.containsKey(next.key) || !PythonPathHelper.canAddAstInfoFor(next.key)) {
                removedKeys.add(next.key);
            }
        }
View Full Code Here


            long last = System.currentTimeMillis();
            int worked = 0;
            try {
                monitor.beginTask("Get modules with token", memoryInfo.o1.size() + memoryInfo.o2.size());
                for (Tuple<CompleteIndexKey, CompleteIndexValue> tup : memoryInfo.o1) {
                    CompleteIndexKey indexKey = tup.o1;
                    CompleteIndexValue obj = tup.o2;

                    worked++;
                    if (monitor.isCanceled()) {
                        return ret;
View Full Code Here

        try {
            synchronized (lock) {
                addAstInfo = super.addAstInfo(node, key, generateDelta);

                if (key.file != null) {
                    completeIndex.add(new CompleteIndexKey(key), new CompleteIndexValue());
                }

            }
        } catch (Exception e) {
            Log.log(e);
View Full Code Here

    public void removeInfoFromModule(String moduleName, boolean generateDelta) {
        synchronized (lock) {
            if (moduleName == null) {
                throw new AssertionError("The module name may not be null.");
            }
            completeIndex.remove(new CompleteIndexKey(moduleName));
            super.removeInfoFromModule(moduleName, generateDelta);
        }
    }
View Full Code Here

            }
        }
    }

    protected void addInfoToModuleOnRestoreInsertCommand(Tuple<ModulesKey, List<IInfo>> data) {
        completeIndex.add(new CompleteIndexKey(data.o1), null);

        //current way (saves a list of iinfo)
        for (Iterator<IInfo> it = data.o2.iterator(); it.hasNext();) {
            IInfo info = it.next();
            if (info.getPath() == null || info.getPath().length() == 0) {
View Full Code Here

TOP

Related Classes of org.python.pydev.core.cache.CompleteIndexKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.