⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pool.java

📁 j2me 游戏 battle_changer(MOTO)工程。可以参考下。
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name:   Pool.java

import java.util.Enumeration;
import java.util.Vector;

class Pool
{
    class Node
    {

        private final Object object;
        private final String id;
        private final int uin;
        private final int size;

        boolean isKey(String s)
        {
            return id.equals(s);
        }

        boolean isKey(int i)
        {
            return uin == i;
        }

        Object getObject()
        {
            return object;
        }

        Node(Object obj, String s, int i, int j)
        {
            object = obj;
            id = s;
            uin = i;
            size = j;
        }
    }


    Vector vector;
    int count;
    int size;

    Pool()
    {
        vector = new Vector();
    }

    Object get(String s)
    {
        Node node = null;
        for(Enumeration enumeration = vector.elements(); enumeration.hasMoreElements();)
        {
            node = (Node)enumeration.nextElement();
            if(node.isKey(s))
                break;
            node = null;
        }

        if(node != null)
            return node.getObject();
        else
            return null;
    }

    void put(Object obj, String s)
    {
        Object obj1 = get(s);
        if(obj1 != null)
            vector.removeElement(obj1);
        vector.addElement(new Node(obj, s, -1, -1));
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -