Package org.hsqldb.lib

Examples of org.hsqldb.lib.HashMap$Values


        String objName;
        String objType;

        // Intermediate holders
        String   className;
        HashMap  hAliases;
        Iterator aliases;
        Object[] row;
        int      pos;

        // Column number mappings
        final int ialias_object_type  = 0;
        final int ialias_object_cat   = 1;
        final int ialias_object_schem = 2;
        final int ialias_object_name  = 3;
        final int ialias_cat          = 4;
        final int ialias_schem        = 5;
        final int ialias              = 6;

        // Initialization
        hAliases = database.getAliasMap();
        aliases  = hAliases.keySet().iterator();
        objType  = "ROUTINE";

        // Do it.
        while (aliases.hasNext()) {
            row     = t.getEmptyRowData();
            alias   = (String) aliases.next();
            objName = (String) hAliases.get(alias);

            // must have class grant to see method call aliases
            pos = objName.lastIndexOf('.');

            if (pos <= 0) {
View Full Code Here


     *
     * @return The requested map
     */
    HashMap getInverseAliasMap() {

        HashMap       mapIn;
        HashMap       mapOut;
        Iterator      keys;
        Object        key;
        Object        value;
        HsqlArrayList keyList;

        // TODO:
        // update Database to dynamically maintain its own
        // inverse alias map.  This will make things *much*
        // faster for our  purposes here, without appreciably
        // slowing down Database
        mapIn  = database.getAliasMap();
        mapOut = new HashMap();
        keys   = mapIn.keySet().iterator();

        while (keys.hasNext()) {
            key     = keys.next();
            value   = mapIn.get(key);
            keyList = (HsqlArrayList) mapOut.get(value);

            if (keyList == null) {
                keyList = new HsqlArrayList();

                mapOut.put(value, keyList);
            }

            keyList.add(key);
        }

View Full Code Here

        Method        method;
        int           mods;
        Object[]      info;
        HsqlArrayList aliasList;
        HsqlArrayList methodList;
        HashMap       invAliasMap;

        try {
            clazz = classForName(className);
        } catch (ClassNotFoundException e) {
            return new WrapperIterator();
        }

        invAliasMap = andAliases ? getInverseAliasMap()
                                 : null;

        // we are interested in inherited methods too,
        // so we use getDeclaredMethods() first.
        // However, under Applet execution or
        // under restrictive SecurityManager policies
        // this may fail, so we use getMethods()
        // if getDeclaredMethods() fails.
        try {
            methods = clazz.getDeclaredMethods();
        } catch (Exception e) {
            methods = clazz.getMethods();
        }

        methodList = new HsqlArrayList(methods.length);

        // add all public static methods to the set
        for (int i = 0; i < methods.length; i++) {
            method = methods[i];
            mods   = method.getModifiers();

            if (!(Modifier.isPublic(mods) && Modifier.isStatic(mods))) {
                continue;
            }

            info = new Object[] {
                method, null, "ROUTINE"
            };

            if (andAliases) {
                info[1] = invAliasMap.get(getMethodFQN(method));
            }

            methodList.add(info);
        }
View Full Code Here

    private static synchronized Database getDatabaseObject(String type,
            String path, HsqlProperties props) throws HsqlException {

        Database db;
        String   key = path;
        HashMap  databaseMap;

        if (type == DatabaseURL.S_FILE) {
            databaseMap = fileDatabaseMap;
            key         = filePathToKey(path);
        } else if (type == DatabaseURL.S_RES) {
            databaseMap = resDatabaseMap;
        } else if (type == DatabaseURL.S_MEM) {
            databaseMap = memDatabaseMap;
        } else {
            throw Trace.runtimeError(Trace.UNSUPPORTED_INTERNAL_OPERATION,
                                     "DatabaseManager.getDatabaseObject");
        }

        db = (Database) databaseMap.get(key);

        if (db == null) {
            db            = new Database(type, path, type + key, props);
            db.databaseID = dbIDCounter;

            databaseIDMap.put(dbIDCounter, db);

            dbIDCounter++;

            databaseMap.put(key, db);
        }

        return db;
    }
View Full Code Here

     */
    private static synchronized Database lookupDatabaseObject(String type,
            String path) throws HsqlException {

        Object  key = path;
        HashMap databaseMap;

        if (type == DatabaseURL.S_FILE) {
            databaseMap = fileDatabaseMap;
            key         = filePathToKey(path);
        } else if (type == DatabaseURL.S_RES) {
            databaseMap = resDatabaseMap;
        } else if (type == DatabaseURL.S_MEM) {
            databaseMap = memDatabaseMap;
        } else {
            throw (Trace.runtimeError(
                Trace.UNSUPPORTED_INTERNAL_OPERATION,
                "DatabaseManager.lookupDatabaseObject()"));
        }

        return (Database) databaseMap.get(key);
    }
View Full Code Here

     */
    private static synchronized void addDatabaseObject(String type,
            String path, Database db) throws HsqlException {

        Object  key = path;
        HashMap databaseMap;

        if (type == DatabaseURL.S_FILE) {
            databaseMap = fileDatabaseMap;
            key         = filePathToKey(path);
        } else if (type == DatabaseURL.S_RES) {
            databaseMap = resDatabaseMap;
        } else if (type == DatabaseURL.S_MEM) {
            databaseMap = memDatabaseMap;
        } else {
            throw Trace.runtimeError(Trace.UNSUPPORTED_INTERNAL_OPERATION,
                                     "DatabaseManager.addDatabaseObject()");
        }

        databaseIDMap.put(db.databaseID, db);
        databaseMap.put(key, db);
    }
View Full Code Here

        int     dbID = database.databaseID;
        String  type = database.getType();
        String  path = database.getPath();
        Object  key  = path;
        HashMap databaseMap;

        notifyServers(database);

        if (type == DatabaseURL.S_FILE) {
            databaseMap = fileDatabaseMap;

// boucherb@users 20040124 - patch 1.7.2
// Under the current contract, it's essentially impossible for an
// exception to get thrown here, because the database could not
// have been registered successfully before hand using the same
// path
//
// Eventually, we might think about storing the key with the
// database instance so as to avoid this unnecessary additional
// conversion and highly unlikely corner case handling.
            try {
                key = filePathToKey(path);
            } catch (HsqlException e) {
                Iterator it       = databaseMap.keySet().iterator();
                Object   foundKey = null;

                while (it.hasNext()) {
                    Object currentKey = it.next();

                    if (databaseMap.get(currentKey) == database) {
                        foundKey = currentKey;

                        break;
                    }
                }

                if (foundKey == null) {
                    e.printStackTrace();

                    // ??? return;
                } else {
                    key = foundKey;
                }
            }
        } else if (type == DatabaseURL.S_RES) {
            databaseMap = resDatabaseMap;
        } else if (type == DatabaseURL.S_MEM) {
            databaseMap = memDatabaseMap;
        } else {
            throw (Trace.runtimeError(
                Trace.UNSUPPORTED_INTERNAL_OPERATION,
                "DatabaseManager.lookupDatabaseObject()"));
        }

        databaseIDMap.remove(dbID);
        databaseMap.remove(key);

        if (databaseIDMap.isEmpty()) {
            ValuePool.resetPool();
        }
    }
View Full Code Here

  IntKeyHashMap asteriskPositions;
  boolean isResolved = false;

  HashMap getColumnAliases()
  {
    HashMap localHashMap = new HashMap();
    for (int i = 0; i < this.iResultLen; i++)
    {
      String str = this.exprColumns[i].getAlias();
      if (str == null)
        continue;
      localHashMap.put(str, this.exprColumns[i]);
    }
    return localHashMap;
  }
View Full Code Here

      addColumn(localTable, "ALIAS_SCHEM", 12);
      addColumn(localTable, "ALIAS", 12, false);
      localTable.createPrimaryKey(null, new int[] { 0, 3, 6 }, true);
      return localTable;
    }
    HashMap localHashMap = this.database.getAliasMap();
    Iterator localIterator1 = localHashMap.keySet().iterator();
    String str5 = "ROUTINE";
    Object[] arrayOfObject;
    String str3;
    String str4;
    String str1;
    String str2;
    while (localIterator1.hasNext())
    {
      arrayOfObject = localTable.getEmptyRowData();
      str3 = (String)localIterator1.next();
      str4 = (String)localHashMap.get(str3);
      int i = str4.lastIndexOf('.');
      if (i <= 0)
        continue;
      String str6 = str4.substring(0, i);
      if (!this.session.isAccessible(str6))
View Full Code Here

    return isReportCatalogs() ? this.catalogName : null;
  }

  HashMap getInverseAliasMap()
  {
    HashMap localHashMap1 = this.database.getAliasMap();
    HashMap localHashMap2 = new HashMap();
    Iterator localIterator = localHashMap1.keySet().iterator();
    while (localIterator.hasNext())
    {
      Object localObject1 = localIterator.next();
      Object localObject2 = localHashMap1.get(localObject1);
      HsqlArrayList localHsqlArrayList = (HsqlArrayList)localHashMap2.get(localObject2);
      if (localHsqlArrayList == null)
      {
        localHsqlArrayList = new HsqlArrayList();
        localHashMap2.put(localObject2, localHsqlArrayList);
      }
      localHsqlArrayList.add(localObject1);
    }
    return localHashMap2;
  }
View Full Code Here

TOP

Related Classes of org.hsqldb.lib.HashMap$Values

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.