A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / JavaModelCache.java
index 4121aa3..41a6458 100644 (file)
@@ -9,6 +9,7 @@
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
 package net.sourceforge.phpdt.internal.core;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -19,18 +20,19 @@ import net.sourceforge.phpdt.core.IJavaElement;
  */
 public class JavaModelCache {
        public static final int PKG_CACHE_SIZE = 500;
+
        public static final int OPENABLE_CACHE_SIZE = 2000;
-       
+
        /**
         * Active Java Model Info
         */
        protected JavaModelInfo modelInfo;
-       
+
        /**
         * Cache of open projects and package fragment roots.
         */
        protected Map projectAndRootCache;
-       
+
        /**
         * Cache of open package fragments
         */
@@ -45,26 +47,31 @@ public class JavaModelCache {
         * Cache of open children of openable Java Model Java elements
         */
        protected Map childrenCache;
-       
-public JavaModelCache() {
-       this.projectAndRootCache = new HashMap(50);
-       this.pkgCache = new HashMap(PKG_CACHE_SIZE);
-       this.openableCache = new ElementCache(OPENABLE_CACHE_SIZE);
-       this.childrenCache = new HashMap(OPENABLE_CACHE_SIZE*20); // average 20 chilren per openable
-}
 
-public double openableFillingRatio() {
-       return this.openableCache.fillingRatio();
-}
-public int pkgSize() {
-       return this.pkgCache.size();
-}
-       
-/**
- *  Returns the info for the element.
- */
-public Object getInfo(IJavaElement element) {
-       switch (element.getElementType()) {
+       public JavaModelCache() {
+               this.projectAndRootCache = new HashMap(50);
+               this.pkgCache = new HashMap(PKG_CACHE_SIZE);
+               this.openableCache = new ElementCache(OPENABLE_CACHE_SIZE);
+               this.childrenCache = new HashMap(OPENABLE_CACHE_SIZE * 20); // average
+                                                                                                                                       // 20
+                                                                                                                                       // chilren
+                                                                                                                                       // per
+                                                                                                                                       // openable
+       }
+
+       public double openableFillingRatio() {
+               return this.openableCache.fillingRatio();
+       }
+
+       public int pkgSize() {
+               return this.pkgCache.size();
+       }
+
+       /**
+        * Returns the info for the element.
+        */
+       public Object getInfo(IJavaElement element) {
+               switch (element.getElementType()) {
                case IJavaElement.JAVA_MODEL:
                        return this.modelInfo;
                case IJavaElement.JAVA_PROJECT:
@@ -77,15 +84,14 @@ public Object getInfo(IJavaElement element) {
                        return this.openableCache.get(element);
                default:
                        return this.childrenCache.get(element);
+               }
        }
-}
 
-/**
- *  Returns the info for this element without
- *  disturbing the cache ordering.
- */
-protected Object peekAtInfo(IJavaElement element) {
-       switch (element.getElementType()) {
+       /**
+        * Returns the info for this element without disturbing the cache ordering.
+        */
+       protected Object peekAtInfo(IJavaElement element) {
+               switch (element.getElementType()) {
                case IJavaElement.JAVA_MODEL:
                        return this.modelInfo;
                case IJavaElement.JAVA_PROJECT:
@@ -98,14 +104,14 @@ protected Object peekAtInfo(IJavaElement element) {
                        return this.openableCache.peek(element);
                default:
                        return this.childrenCache.get(element);
+               }
        }
-}
 
-/**
- * Remember the info for the element.
- */
-protected void putInfo(IJavaElement element, Object info) {
-       switch (element.getElementType()) {
+       /**
+        * Remember the info for the element.
+        */
+       protected void putInfo(IJavaElement element, Object info) {
+               switch (element.getElementType()) {
                case IJavaElement.JAVA_MODEL:
                        this.modelInfo = (JavaModelInfo) info;
                        break;
@@ -122,13 +128,14 @@ protected void putInfo(IJavaElement element, Object info) {
                        break;
                default:
                        this.childrenCache.put(element, info);
+               }
        }
-}
-/**
- * Removes the info of the element from the cache.
- */
-protected void removeInfo(IJavaElement element) {
-       switch (element.getElementType()) {
+
+       /**
+        * Removes the info of the element from the cache.
+        */
+       protected void removeInfo(IJavaElement element) {
+               switch (element.getElementType()) {
                case IJavaElement.JAVA_MODEL:
                        this.modelInfo = null;
                        break;
@@ -145,6 +152,6 @@ protected void removeInfo(IJavaElement element) {
                        break;
                default:
                        this.childrenCache.remove(element);
+               }
        }
 }
-}