📄 dxtreeset.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: DxTreeSet.java,v 1.7 2000/10/28 16:55:14 daniela Exp $package org.ozoneDB.DxLib;import java.util.*;import java.io.*;/** * * * @author <a href="http://www.softwarebuero.de/">SMB</a> * @version $Revision: 1.7 $Date: 2000/10/28 16:55:14 $ */public class DxTreeSet extends DxAbstractSet implements DxTreeCollection { //, Externalizable { final static long serialVersionUID = 1L; protected transient DxBBTree bbtree; protected DxComparator comparator; /** * Constructs a new, empty set. All keys inserted into the map must * implement the DxComparable interface. */ public DxTreeSet() { comparator = new DxStandardComparator(); bbtree = new DxBBTree( comparator ); } /** * Constructs a new, empty set, sorted according to the given comparator. * All inserted objects must be comparable by the given comparator. */ public DxTreeSet( DxComparator _comparator ) { comparator = _comparator; bbtree = new DxBBTree( comparator ); } public Object clone() { DxSet newSet = new DxTreeSet( comparator ); return clone( newSet ); } public synchronized boolean add( Object obj ) { return bbtree.addForKey( obj, obj ); } public synchronized boolean remove( Object obj ) { return bbtree.removeForKey( obj ) != null; } public boolean contains( Object obj ) { return bbtree.containsKey( obj ); } public DxIterator iterator() { return new DxBBIterator( this ); } public int count() { return bbtree.count(); } public boolean isEmpty() { return bbtree.isEmpty(); } public synchronized void clear() { bbtree = new DxBBTree(); } public DxBBTree internalTree() { return bbtree; } // public void writeExternal (ObjectOutput out) throws IOException { // // System.out.println (getClass().getName() + ".writeExternal()..."); // out.writeObject (comparator); // super.writeExternal (out); // } // // // public synchronized void readExternal (ObjectInput in) throws IOException, ClassNotFoundException { // comparator = (DxComparator)in.readObject(); // bbtree = new DxBBTree (comparator); // super.readExternal (in); // } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -