dxhashset.java

来自「用Java写的面相对象的数据库管理系统」· Java 代码 · 共 88 行

JAVA
88
字号
// 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-2000 by SMB GmbH. All rights reserved.//// $Id: DxHashSet.java,v 1.8 2000/10/28 16:55:14 daniela Exp $package org.ozoneDB.DxLib;import java.util.*;/** *  *  * @author <a href="http://www.softwarebuero.de/">SMB</a> * @version $Revision: 1.8 $Date: 2000/10/28 16:55:14 $ */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;    } }

⌨️ 快捷键说明

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