Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed unused class FixedSizeStack

Java collections stacks/queues offer much better implementations and it
wasn't used

Change-Id: I3fa5e48d085248b3ce6d389bdeb098d564d110e0
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information...
commit 3f37d8c0448fc8f72798ebb40d1113bc471382de 1 parent d5c9a77
John May authored egonw committed
83  src/main/org/openscience/cdk/tools/FixedSizeStack.java
... ...
@@ -1,83 +0,0 @@
1  
-/*
2  
- * $RCSfile$
3  
- * $Author$
4  
- * $Date$
5  
- * $Revision$
6  
- *
7  
- * Copyright (C) 1997-2007  The Chemistry Development Kit (CDK) project
8  
- *
9  
- * Contact: cdk-devel@lists.sourceforge.net
10  
- *
11  
- * This program is free software; you can redistribute it and/or
12  
- * modify it under the terms of the GNU Lesser General Public License
13  
- * as published by the Free Software Foundation; either version 2.1
14  
- * of the License, or (at your option) any later version.
15  
- * All we ask is that proper credit is given for our work, which includes
16  
- * - but is not limited to - adding the above copyright notice to the beginning
17  
- * of your source code files, and to any copyright notice that you may distribute
18  
- * with programs based on this work.
19  
- *
20  
- * This program is distributed in the hope that it will be useful,
21  
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  
- * GNU Lesser General Public License for more details.
24  
- *
25  
- * You should have received a copy of the GNU Lesser General Public License
26  
- * along with this program; if not, write to the Free Software
27  
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
28  
- *
29  
- */
30  
-
31  
-package org.openscience.cdk.tools;
32  
-
33  
-/**
34  
- *  A LIFO queue for result structures. The Size is fixed so that one can use
35  
- *  this to hold the 10 best structures, e. g.
36  
- *
37  
- *@author     steinbeck
38  
- * @cdk.githash
39  
- *@cdk.created    2001-06-05
40  
- */
41  
-public class FixedSizeStack extends java.util.Vector implements java.io.Serializable {
42  
-
43  
-    private static final long serialVersionUID = 7820949609007415936L;
44  
-    
45  
-    private int size;
46  
-
47  
-	/**
48  
-	 *  Creates a fixed size stack
49  
-	 *
50  
-	 *@param  size  The size of this stack
51  
-	 */
52  
-	public FixedSizeStack(int size) {
53  
-		super();
54  
-		this.size = size;
55  
-	}
56  
-
57  
-
58  
-	/**
59  
-	 * Pushes an object onto the stack. If the new size then exceeds the 
60  
-	 * standard size of this stack, the oldest elements in the stack are discarded. 
61  
-	 *
62  
-	 *@param  O  The object to be pushed onto the stack
63  
-	 */
64  
-	public void push(Object O) {
65  
-		insertElementAt(O, 0);
66  
-		if (size() > size) {
67  
-			setSize(size);
68  
-		}
69  
-	}
70  
-
71  
-
72  
-	/**
73  
-	 *  Returns the last object that was pushed onto the stack
74  
-	 *
75  
-	 *@return    the last object that was pushed onto the stack
76  
-	 */
77  
-	public Object pop() {
78  
-		Object O = elementAt(0);
79  
-		removeElementAt(0);
80  
-		return O;
81  
-	}
82  
-}
83  
-

0 notes on commit 3f37d8c

Please sign in to comment.
Something went wrong with that request. Please try again.