Package org.hsqldb.lib

Examples of org.hsqldb.lib.IntKeyIntValueHashMap$KeySet


            case FUNC_TRANSLATE : {
                if (data[0] == null || data[1] == null || data[2] == null) {
                    return null;
                }

                IntKeyIntValueHashMap map = charLookup;

                if (map == null) {
                    map = getTranslationMap((String) data[1],
                                            (String) data[2]);
                }
View Full Code Here


        return part;
    }

    IntKeyIntValueHashMap getTranslationMap(String source, String dest) {

        IntKeyIntValueHashMap map = new IntKeyIntValueHashMap();

        for (int i = 0; i < source.length(); i++) {
            int character = source.charAt(i);

            if (i >= dest.length()) {
                map.put(character, -1);

                continue;
            }

            int value = dest.charAt(i);

            map.put(character, value);
        }

        return map;
    }
View Full Code Here

        this.database = database;
        schemaMap     = new IntKeyHashMap();
        sqlLookup     = new IntKeyHashMap();
        csidMap       = new IntKeyHashMap();
        sessionUseMap = new IntKeyHashMap();
        useMap        = new IntKeyIntValueHashMap();
        next_cs_id    = 0;
    }
View Full Code Here

     * @param csid the compiled statement identifier
     * @param sid the session identifier
     */
    private void linkSession(int csid, int sid) {

        IntKeyIntValueHashMap scsMap;

        scsMap = (IntKeyIntValueHashMap) sessionUseMap.get(sid);

        if (scsMap == null) {
            scsMap = new IntKeyIntValueHashMap();

            sessionUseMap.put(sid, scsMap);
        }

        int count = scsMap.get(csid, 0);

        scsMap.put(csid, count + 1);

        if (count == 0) {
            useMap.put(csid, useMap.get(csid, 0) + 1);
        }
    }
View Full Code Here

            // statement was never added
            return;
        }

        IntKeyIntValueHashMap scsMap =
            (IntKeyIntValueHashMap) sessionUseMap.get(sid);

        if (scsMap == null) {

            // statement already removed due to invalidation
            return;
        }

        int sessionUseCount = scsMap.get(csid, 0);

        if (sessionUseCount == 0) {

            // statement already removed due to invalidation
        } else if (sessionUseCount == 1 || freeAll) {
            scsMap.remove(csid);

            int usecount = useMap.get(csid, 0);

            if (usecount == 0) {

                // statement already removed due to invalidation
            } else if (usecount == 1) {
                CompiledStatement cs =
                    (CompiledStatement) csidMap.remove(csid);

                if (cs != null) {
                    int schemaid = cs.schemaHsqlName.hashCode();
                    IntValueHashMap sqlMap =
                        (IntValueHashMap) schemaMap.get(schemaid);
                    String sql = (String) sqlLookup.remove(csid);

                    sqlMap.remove(sql);
                }

                useMap.remove(csid);
            } else {
                useMap.put(csid, usecount - 1);
            }
        } else {
            scsMap.put(csid, sessionUseCount - 1);
        }
    }
View Full Code Here

     *
     * @param sid the session identifier
     */
    synchronized void removeSession(int sid) {

        IntKeyIntValueHashMap scsMap;
        int                   csid;
        Iterator              i;

        scsMap = (IntKeyIntValueHashMap) sessionUseMap.remove(sid);

        if (scsMap == null) {
            return;
        }

        i = scsMap.keySet().iterator();

        while (i.hasNext()) {
            csid = i.nextInt();

            int usecount = useMap.get(csid, 1) - 1;
View Full Code Here

        this.database = database;
        schemaMap     = new IntKeyHashMap();
        sqlLookup     = new IntKeyHashMap();
        csidMap       = new IntKeyHashMap();
        sessionUseMap = new IntKeyHashMap();
        useMap        = new IntKeyIntValueHashMap();
        next_cs_id    = 0;
    }
View Full Code Here

     * @param csid the compiled statement identifier
     * @param sid the session identifier
     */
    private void linkSession(int csid, int sid) {

        IntKeyIntValueHashMap scsMap;

        scsMap = (IntKeyIntValueHashMap) sessionUseMap.get(sid);

        if (scsMap == null) {
            scsMap = new IntKeyIntValueHashMap();

            sessionUseMap.put(sid, scsMap);
        }

        int count = scsMap.get(csid, 0);

        scsMap.put(csid, count + 1);

        if (count == 0) {
            useMap.put(csid, useMap.get(csid, 0) + 1);
        }
    }
View Full Code Here

            // statement was never added
            return;
        }

        IntKeyIntValueHashMap scsMap =
            (IntKeyIntValueHashMap) sessionUseMap.get(sid);

        if (scsMap == null) {

            // statement already removed due to invalidation
            return;
        }

        int sessionUseCount = scsMap.get(csid, 0);

        if (sessionUseCount == 0) {

            // statement already removed due to invalidation
        } else if (sessionUseCount == 1 || freeAll) {
            scsMap.remove(csid);

            int usecount = useMap.get(csid, 0);

            if (usecount == 0) {

                // statement already removed due to invalidation
            } else if (usecount == 1) {
                CompiledStatement cs =
                    (CompiledStatement) csidMap.remove(csid);

                if (cs != null) {
                    int schemaid = cs.schemaHsqlName.hashCode();
                    IntValueHashMap sqlMap =
                        (IntValueHashMap) schemaMap.get(schemaid);
                    String sql = (String) sqlLookup.remove(csid);

                    sqlMap.remove(sql);
                }

                useMap.remove(csid);
            } else {
                useMap.put(csid, usecount - 1);
            }
        } else {
            scsMap.put(csid, sessionUseCount - 1);
        }
    }
View Full Code Here

     *
     * @param sid the session identifier
     */
    synchronized void removeSession(int sid) {

        IntKeyIntValueHashMap scsMap;
        int                   csid;
        Iterator              i;

        scsMap = (IntKeyIntValueHashMap) sessionUseMap.remove(sid);

        if (scsMap == null) {
            return;
        }

        i = scsMap.keySet().iterator();

        while (i.hasNext()) {
            csid = i.nextInt();

            int usecount = useMap.get(csid, 1) - 1;
View Full Code Here

TOP

Related Classes of org.hsqldb.lib.IntKeyIntValueHashMap$KeySet

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.