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

📄 dxhashset.java

📁 Java的面向对象数据库系统的源代码
💻 JAVA
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.//// $Id: DxHashSet.java,v 1.1.2.1 2002/05/21 20:14:38 mediumnet Exp $package org.ozoneDB.DxLib;import java.util.*;/** *  *  * @author <a href="http://www.softwarebuero.de/">SMB</a> * @version $Revision: 1.1.2.1 $Date: 2002/05/21 20:14:38 $ */public class DxHashSet extends DxAbstractSet implements DxHashCollection {        final static long serialVersionUID = 1L;        protected Hashtable ht;            public DxHashSet() {        ht = new Hashtable();    }            public DxHashSet( int initSize ) {        ht = new Hashtable( initSize );    }            public Object clone() {        DxSet newSet = new DxHashSet( count() );        return clone( newSet );    }             public synchronized boolean add( Object obj ) {        Object old = ht.put( obj, obj );        if (old != null) {            ht.put( old, old );            return false;        } else {            return true;        }     }             public synchronized boolean remove( Object obj ) {        Object old = ht.remove( obj );        return old != null;    }             public boolean contains( Object obj ) {        return ht.containsKey( obj );    }             public DxIterator iterator() {        return new DxHashIterator( this );    }             public int count() {        return ht.size();    }             public boolean isEmpty() {        return ht.isEmpty();    }             public synchronized void clear() {        ht.clear();    }             public Hashtable internalHashtable() {        return ht;    }     public String toString() {        StringBuffer b = new StringBuffer((ht.size()+1)<<4);        b.append("DxHashSet{");        DxIterator iterator = iterator();        boolean    comma    = false;        while (iterator.next()!=null) {            if (comma) {                b.append(',');            } else {                comma = true;            }            b.append(iterator.key());        }        b.append("}");        return b.toString();    }}

⌨️ 快捷键说明

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