📄 dxhashset.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-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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -