1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * ident "%Z%%M% %I% %E% SMI" 24 * 25 * Copyright (c) 2000 by Sun Microsystems, Inc. 26 * All rights reserved. 27 */ 28 29 /* 30 * Copyright (C) 1996 Active Software, Inc. 31 * All rights reserved. 32 * 33 * @(#) StringVector.java 1.3 - last change made 04/25/96 34 */ 35 36 package sunsoft.jws.visual.rt.awt; 37 38 import java.util.Vector; 39 import java.util.Enumeration; 40 41 public final class StringVector { 42 Vector vector; 43 StringVector(int initialCapacity, int capacityIncrement)44 public StringVector(int initialCapacity, int capacityIncrement) { 45 vector = new Vector(initialCapacity, capacityIncrement); 46 } 47 StringVector(int initialCapacity)48 public StringVector(int initialCapacity) { 49 vector = new Vector(initialCapacity); 50 } 51 StringVector()52 public StringVector() { 53 vector = new Vector(); 54 } 55 copyInto(String anArray[])56 public final void copyInto(String anArray[]) { 57 vector.copyInto(anArray); 58 } 59 trimToSize()60 public final void trimToSize() { 61 vector.trimToSize(); 62 } 63 ensureCapacity(int minCapacity)64 public final void ensureCapacity(int minCapacity) { 65 vector.ensureCapacity(minCapacity); 66 } 67 setSize(int newSize)68 public final void setSize(int newSize) { 69 vector.setSize(newSize); 70 } 71 capacity()72 public final int capacity() { 73 return vector.capacity(); 74 } 75 size()76 public final int size() { 77 return vector.size(); 78 } 79 isEmpty()80 public final boolean isEmpty() { 81 return vector.isEmpty(); 82 } 83 elements()84 public final Enumeration elements() { 85 return vector.elements(); 86 } 87 contains(String elem)88 public final boolean contains(String elem) { 89 return vector.contains(elem); 90 } 91 indexOf(String elem)92 public final int indexOf(String elem) { 93 return vector.indexOf(elem); 94 } 95 indexOf(String elem, int index)96 public final int indexOf(String elem, int index) { 97 return vector.indexOf(elem, index); 98 } 99 lastIndexOf(String elem)100 public final int lastIndexOf(String elem) { 101 return vector.lastIndexOf(elem); 102 } 103 lastIndexOf(String elem, int index)104 public final int lastIndexOf(String elem, int index) { 105 return vector.lastIndexOf(elem, index); 106 } 107 elementAt(int index)108 public final String elementAt(int index) { 109 return (String)vector.elementAt(index); 110 } 111 firstElement()112 public final String firstElement() { 113 return (String)vector.firstElement(); 114 } 115 lastElement()116 public final String lastElement() { 117 return (String)vector.lastElement(); 118 } 119 setElementAt(String obj, int index)120 public final void setElementAt(String obj, int index) { 121 vector.setElementAt(obj, index); 122 } 123 removeElementAt(int index)124 public final void removeElementAt(int index) { 125 vector.removeElementAt(index); 126 } 127 insertElementAt(String obj, int index)128 public final void insertElementAt(String obj, int index) { 129 vector.insertElementAt(obj, index); 130 } 131 addElement(String obj)132 public final void addElement(String obj) { 133 vector.addElement(obj); 134 } 135 removeElement(Object obj)136 public final boolean removeElement(Object obj) { 137 return vector.removeElement(obj); 138 } 139 removeAllElements()140 public final void removeAllElements() { 141 vector.removeAllElements(); 142 } 143 clone()144 public synchronized Object clone() { 145 try { 146 StringVector v = (StringVector)super.clone(); 147 v.vector = (Vector)vector.clone(); 148 return v; 149 } catch (CloneNotSupportedException e) { 150 // this shouldn't happen, since we are Cloneable 151 throw new InternalError(); 152 } 153 } 154 toString()155 public String toString() { 156 return vector.toString(); 157 } 158 } 159