`
isiqi
  • 浏览: 16029365 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

java.util.Vector翻译

阅读更多
<!-- ========= START OF TOP NAVBAR ======= --><!-- -->
JavaTM2Platform
Std.Ed. v1.4.2
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->

java.util
Class Vector

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
All Implemented Interfaces:
Cloneable, Collection, List, RandomAccess, Serializable
Direct Known Subclasses:
Stack

public class Vector
extends AbstractList
implements List, RandomAccess, Cloneable, Serializable

The Vector class implements a growable array of objects. Like an array, it contains components that can be accessed using an integer index. However, the size of a Vector can grow or shrink as needed to accommodate adding and removing items after the Vector has been created. Vector类实现了一个可增长对象数组。和数组一样,它所包含的成员可以使用整型 下标访问。然而,Vector可以创建后在添加或删除项有需要时增加或减小大小。

Each vector tries to optimize storage management by maintaining a capacity and a capacityIncrement. The capacity is always at least as large as the vector size; it is usually larger because as components are added to the vector, the vector's storage increases in chunks the size of capacityIncrement. An application can increase the capacity of a vector before inserting a large number of components; this reduces the amount of incremental reallocation. 每一个vector都试图通过对capacity和capacityIncrement的维护来优化存储管理。 capacity至少应和vector的大小一样,通常情况下要更大,因为成员被加入vector 时,vector的容量每次会增加capacityIncrement的大小。应用程序可以在插入 大量成员之前增加vector的大小,这将减少增长重分配的次数。

As of the Java 2 platform v1.2, this class has been retrofitted to implement List, so that it becomes a part of Java's collection framework. Unlike the new collection implementations, Vector is synchronized. 从Java 2平台1.2以来,该类已作更改以实现List,因此它成了Java集合框架的一部分。 和其他新的集合实现不同,Vector是同步化的。

The Iterators returned by Vector's iterator and listIterator methods are fail-fast: if the Vector is structurally modified at any time after the Iterator is created, in any way except through the Iterator's own remove or add methods, the Iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the Iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future. The Enumerations returned by Vector's elements method are not fail-fast. 由Vector的的iterator和listIterator方法返回的Iterator也具有fail-fast特性:即如果Vector在Iterator创建后使用除Iterator自身的remove或add方法以外的方式使其有了结构性更改,Iterator将抛出ConcurrentModificationException。因此,遇到同步修改时,Iterator会立即失败,宁可不冒未来某一时刻不能确定的行为风险。 Vector的elements方法返回的Enumeration不具有fail-fast特性。

Note that the fail-fast behavior of an iterator cannot be guaranteed as it is, generally speaking, impossible to make any hard guarantees in the presence of unsynchronized concurrent modification. Fail-fast iterators throw ConcurrentModificationException on a best-effort basis. Therefore, it would be wrong to write a program that depended on this exception for its correctness: the fail-fast behavior of iterators should be used only to detect bugs. 注意迭代器的fail-fast特性不能保证,正如在非同步化修改中做保证也是不可能的。 具有fail-fast特性的迭代器会基于最有效原则抛出 ConcurrentModificationException, 因此写的程序依赖于该异常来纠正是错误的:迭代器的fail-fast特性应该只用来调试bug。

This class is a member of the Java Collections Framework. 该接口是Java集合框架成员之一。

Since:
JDK1.0
See Also:
Collection, List, ArrayList, LinkedList, Serialized Form

<!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- -->

Field Summary
protected int capacityIncrement
The amount by which the capacity of the vector is automatically incremented when its size becomes greater than its capacity. 当vector的大小超出它的容量时,容量的自动增加量。
protected int elementCount
The number of valid components in this Vector object. Vector对象的有效成员数。
protected Object[] elementData
The array buffer into which the components of the vector are stored. 存储vector成员的数组缓冲。
<!-- -->
Fields inherited from class java.util.AbstractList
modCount
<!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- -->
Constructor Summary
Vector()
Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero. 构造一个空vector,内部数据数组大小为10,标准容量增长量为0。
Vector(Collectionc)
Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator. 构造一个vector,包含指定集合的元素,顺序为集合迭代器的返回顺序。
Vector(intinitialCapacity)
Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero. 构造一个空vector,指定初始容量,标准容量增长量为0。
Vector(intinitialCapacity, intcapacityIncrement)
Constructs an empty vector with the specified initial capacity and capacity increment. 构造一个空vector,指定初始容量和标准容量增长量。
<!-- ========== METHOD SUMMARY =========== --><!-- -->
Method Summary
void add(intindex, Objectelement)
Inserts the specified element at the specified position in this Vector. 向Vector指定位置插入指定元素。
boolean add(Objecto)
Appends the specified element to the end of this Vector. 向Vector末尾添加指定元素。
boolean addAll(Collectionc)
Appends all of the elements in the specified Collection to the end of this Vector, in the order that they are returned by the specified Collection's Iterator. 向Vector尾部追加指定集合的所有元素,以指定集合的Iterator返回顺序为序。
boolean addAll(intindex, Collectionc)
Inserts all of the elements in in the specified Collection into this Vector at the specified position. 向Vector指定位置插入指定Collection的所有元素。
void addElement(Objectobj)
Adds the specified component to the end of this vector, increasing its size by one. 向Vector末尾添加指定元素,大小加1。
int capacity()
Returns the current capacity of this vector. 返回当前vector的容量。
void clear()
Removes all of the elements from this Vector. 从Vector中删除所有元素。
Object clone()
Returns a clone of this vector. 返回vector的克隆。
boolean contains(Objectelem)
Tests if the specified object is a component in this vector. 测试指定对象是否是vector的成员。
boolean containsAll(Collectionc)
Returns true if this Vector contains all of the elements in the specified Collection. 如果Vector包含指定集合的所有元素,返回true。
void copyInto(Object[]anArray)
Copies the components of this vector into the specified array. 向指定数组拷贝vector的成员。
Object elementAt(intindex)
Returns the component at the specified index. 返回指定下标的成员。
Enumeration elements()
Returns an enumeration of the components of this vector. 返回vector的成员枚举。
void ensureCapacity(intminCapacity)
Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument. 增加vector的容量,确保能容纳由minCapacity参数指定的成员数量。
boolean equals(Objecto)
Compares the specified Object with this Vector for equality. 将指定对象和当前Vector比较相等性。
Object firstElement()
Returns the first component (the item at index 0) of this vector. 返回vector的第一个成员(下标为0)。
Object get(intindex)
Returns the element at the specified position in this Vector. 返回Vector中指定位置的元素。
int hashCode()
Returns the hash code value for this Vector. 返回Vector的哈希码值。
int indexOf(Objectelem)
Searches for the first occurence of the given argument, testing for equality using the equals method. 查找指定参数第一次出现的位置,使用equals方法测试相等性。
int indexOf(Objectelem, intindex)
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. 由下标index开始查找指定参数第一次出现的位置,使用equals方法测试相等性。
void insertElementAt(Objectobj, intindex)
Inserts the specified object as a component in this vector at the specified index. 以指定对象为成员插入vector指定下标位置处。
boolean isEmpty()
Tests if this vector has no components. 测试vector是否没有成员。
Object lastElement()
Returns the last component of the vector. 返回vector的最后一个成员。
int lastIndexOf(Objectelem)
Returns the index of the last occurrence of the specified object in this vector. 返回vector中指定对象最后一次出现的下标。
int lastIndexOf(Objectelem, intindex)
Searches backwards for the specified object, starting from the specified index, and returns an index to it. 由指定下标开始,向后查找指定对象,返回对象的下标。
Object remove(intindex)
Removes the element at the specified position in this Vector. 从Vector中删除指定位置的元素。
boolean remove(Objecto)
Removes the first occurrence of the specified element in this Vector If the Vector does not contain the element, it is unchanged. 从Vector中删除第一个出现的指定元素。如果不含该元素,Vector不变。
boolean removeAll(Collectionc)
Removes from this Vector all of its elements that are contained in the specified Collection. 从Vector中删除指定集合包含的所有元素。
void removeAllElements()
Removes all components from this vector and sets its size to zero. 删除vector的所有成员,大小设为0。
boolean removeElement(Objectobj)
Removes the first (lowest-indexed) occurrence of the argument from this vector. 从vector中删除第一个(下标最小)出现的参数。
void removeElementAt(intindex)
Deletes the component at the specified index. 删除指定下标的成员。
protected void removeRange(intfromIndex, inttoIndex)
Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive. 从List中删除下标在fromIndex(含)和toIndex(不含)之间的所有元素。
boolean retainAll(Collectionc)
Retains only the elements in this Vector that are contained in the specified Collection. 使Vector只保留指定集合中所含的元素。
Object set(intindex, Objectelement)
Replaces the element at the specified position in this Vector with the specified element. 用指定元素替换Vector指定位置的元素。
void setElementAt(Objectobj, intindex)
Sets the component at the specified index of this vector to be the specified object. 将vector指定下标的成员设为指定对象。
void setSize(intnewSize)
Sets the size of this vector. 设置vector的大小。
int size()
Returns the number of components in this vector. 返回vector的成员数量。
List subList(intfromIndex, inttoIndex)
Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive. 返回List中下标在fromIndex(含)和toIndex(不含)之间的元素视图。
Object[] toArray()
Returns an array containing all of the elements in this Vector in the correct order. 返回一个数组,以正确的顺序包含Vector的所有元素。
Object[] toArray(Object[]a)
Returns an array containing all of the elements in this Vector in the correct order; the runtime type of the returned array is that of the specified array. 返回一个数组,以正确的顺序包含Vector的所有元素,返回数组的运行时类型为指定数组的类型。
String toString()
Returns a string representation of this Vector, containing the String representation of each element. 返回Vector的字符串形式,包含每一个元素的字符串形式。
void trimToSize()
Trims the capacity of this vector to be the vector's current size. 将vector的容量调整为vector的当前大小。
<!-- -->
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
<!-- -->
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
<!-- -->
Methods inherited from interface java.util.List
iterator, listIterator, listIterator

<!-- ============ FIELD DETAIL =========== --><!-- -->

Field Detail
<!-- -->

elementData

protected Object[] elementData
The array buffer into which the components of the vector are stored. The capacity of the vector is the length of this array buffer, and is at least large enough to contain all the vector's elements. 存储vector成员的数组缓冲。vector的容量为数组缓冲的长度,至少应能容纳vector的所有元素。

Any array elements following the last element in the Vector are null. 紧随Vector最后一个元素的任意数组元素为null。


<!-- -->

elementCount

protected int elementCount
The number of valid components in this Vector object. Components elementData[0] through elementData[elementCount-1] are the actual items. Vector对象的有效成员数。成员elementData[0]到elementData[elementCount-1]是现有的项。


<!-- -->

capacityIncrement

protected int capacityIncrement
The amount by which the capacity of the vector is automatically incremented when its size becomes greater than its capacity. If the capacity increment is less than or equal to zero, the capacity of the vector is doubled each time it needs to grow. 当vector的大小超出它的容量时,容量的自动增加量。如果容量增加量小于等于0, 那么每次当vector需要增长时容量翻倍。

<!-- ========= CONSTRUCTOR DETAIL ======== --><!-- -->
Constructor Detail
<!-- -->

Vector

public Vector(intinitialCapacity,
              intcapacityIncrement)
Constructs an empty vector with the specified initial capacity and capacity increment. 构造一个空vector,指定初始容量和标准容量增长量。

Parameters:
initialCapacity - the initial capacity of the vector. vector的初始容量。
capacityIncrement - the amount by which the capacity is increased when the vector overflows. 当vector填满时增加的容量值。
Throws:
IllegalArgumentException - if the specified initial capacity is negative 如果指定初始容量为负时抛出

<!-- -->

Vector

public Vector(intinitialCapacity)
Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero. 构造一个空vector,指定初始容量,标准容量增长量为0。

Parameters:
initialCapacity - the initial capacity of the vector. vector的初始容量。
Throws:
IllegalArgumentException - if the specified initial capacity is negative 如果指定初始容量为负时抛出

<!-- -->

Vector

public Vector()
Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero. 构造一个空vector,内部数据数组大小为10,标准容量增长量为0。


<!-- -->

Vector

public Vector(Collectionc)
Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator. 构造一个vector,包含指定集合的元素,顺序为集合迭代器的返回顺序。

Parameters:
c - the collection whose elements are to be placed into this vector. 被放入vector的元素集合。
Throws:
NullPointerException - if the specified collection is null.] 如果指定集合为null时抛出。
Since:
1.2
<!-- ============ METHOD DETAIL ========== --><!-- -->
Method Detail
<!-- -->

copyInto

public void copyInto(Object[]anArray)
Copies the components of this vector into the specified array. The item at index k in this vector is copied into component k of anArray. The array must be big enough to hold all the objects in this vector, else an IndexOutOfBoundsException is thrown. 向指定数组拷贝vector的成员。vector中下标k处的项被拷贝至anArray的成员k。 数组必须足够大以能容纳vector中的所有对象,否则抛出IndexOutOfBoundsException。

Parameters:
anArray - the array into which the components get copied. 成员被拷贝至的数组。
Throws:
NullPointerException - if the given array is null. 如果指定数组为null时抛出。

<!-- -->

trimToSize

public void trimToSize()
Trims the capacity of this vector to be the vector's current size. If the capacity of this vector is larger than its current size, then the capacity is changed to equal the size by replacing its internal data array, kept in the field elementData, with a smaller one. An application can use this operation to minimize the storage of a vector. 将vector的容量调整为vector的当前大小。如果vector的容量大于当前大小, 那么通过替换内部数据数组(由elementData域维护)来使得容量和大小相等。 应用程序可以使用该操作来减小vector的存储量。


<!-- -->

ensureCapacity

public void ensureCapacity(intminCapacity)
Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument. 增加vector的容量,确保能容纳由minCapacity参数指定的成员数量。

If the current capacity of this vector is less than minCapacity, then its capacity is increased by replacing its internal data array, kept in the field elementData, with a larger one. The size of the new data array will be the old size plus capacityIncrement, unless the value of capacityIncrement is less than or equal to zero, in which case the new capacity will be twice the old capacity; but if this new size is still smaller than minCapacity, then the new capacity will be minCapacity. 如果vector的当前容量小于minCapacity,那么通过替换其内部数据数组(由elementData 维护)来增加其容量。数据数组的新的大小将是在旧的大小上加上capacityIncrement, 除非capacityIncrement值小于等于0,这种情况下新的容量将是旧容量的两倍, 但是如果新的大小仍然小于minCapacity,那么新的容量将是minCapacity。

Parameters:
minCapacity - the desired minimum capacity. 期望的最小容量。

<!-- -->

setSize

public void setSize(intnewSize)
Sets the size of this vector. If the new size is greater than the current size, new null items are added to the end of the vector. If the new size is less than the current size, all components at index newSize and greater are discarded. 设置vector的大小。如果新的大小大于当前大小,那么向vector尾部添加新的null项。 如果新的大小小于当前大小,所有位于下标newSize和大于该下标的成员全都被丢弃。

Parameters:
newSize - the new size of this vector. vector新的大小。
Throws:
ArrayIndexOutOfBoundsException - if new size is negative.

<!-- -->

capacity

public int capacity()
Returns the current capacity of this vector. 返回当前vector的容量。

Returns:
the current capacity (the length of its internal data array, kept in the field elementData of this vector). 当前容量(内部数据数组的长度,由vector的elementData域维护)。

<!-- -->

size

public int size()
Returns the number of components in this vector. 返回vector的成员数量。

Specified by:
size in interface List
Specified by:
size in class AbstractCollection
Returns:
the number of components in this vector. vector的成员数量。

<!-- -->

isEmpty

public boolean isEmpty()
Tests if this vector has no components. 测试vector是否没有成员。

Specified by:
isEmpty in interface List
Overrides:
isEmpty in class AbstractCollection
Returns:
true if and only if this vector has no components, that is, its size is zero; false otherwise. 只有当vector不含元素,即大小为0时,返回true;否则为false。

<!-- -->

elements

public Enumeration elements()
Returns an enumeration of the components of this vector. The returned Enumeration object will generate all items in this vector. The first item generated is the item at index 0, then the item at index 1, and so on. 返回vector的成员枚举。返回的Enumeration对象将生成vector的所有项。生成的第一项 下标为0,第二项下标为1,以此类推。

Returns:
an enumeration of the components of this vector. vector的成员枚举。
See Also:
Enumeration, Iterator

<!-- -->

contains

public boolean contains(Objectelem)
Tests if the specified object is a component in this vector. 测试指定对象是否是vector的成员。

Specified by:
contains in interface List
Overrides:
contains in class AbstractCollection
Parameters:
elem - an object. 一个对象。
Returns:
true if and only if the specified object is the same as a component in this vector, as determined by the equals method; false otherwise. 只有当指定的对象和vector的一个成员相同(由equals方法确定)时返回true,否则返回false。

<!-- -->

indexOf

public int indexOf(Objectelem)
Searches for the first occurence of the given argument, testing for equality using the equals method. 查找指定参数第一次出现的位置,使用equals方法测试相等性。

Specified by:
indexOf in interface List
Overrides:
indexOf in class AbstractList
Parameters:
elem - an object. 对象。
Returns:
the index of the first occurrence of the argument in this vector, that is, the smallest value k such that elem.equals(elementData[k]) is true; returns -1 if the object is not found. 参数在vector中第一次出现的位置,即使得elem.equals(elementData[k])为true的最小值k, 如果找不到该对象,返回-1。
See Also:
Object.equals(Object)

<!-- -->

indexOf

public int indexOf(Objectelem,
                   intindex)
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. 由下标index开始查找指定参数第一次出现的位置,使用equals方法测试相等性。

Parameters:
elem - an object.
index - the non-negative index to start searching from.
Returns:
the index of the first occurrence of the object argument in this vector at position index or later in the vector, that is, the smallest value k such that elem.equals(elementData[k]) && (k >= index) is true; returns -1 if the object is not found. (Returns -1 if index >= the current size of this Vector.) 对象参数在vector中从位置index开始第一次出现的位置,即使得elem.equals(elementData[k]) && (k >= index)为true的最小值k,如果找不到该对象,返回-1。 (如果index >= Vector的当前大小,返回-1。)
Throws:
IndexOutOfBoundsException - if index is negative. 如果index为负时抛出。
See Also:
Object.equals(Object)

<!-- -->

lastIndexOf

public int lastIndexOf(Objectelem)
Returns the index of the last occurrence of the specified object in this vector. 返回vector中指定对象最后一次出现的下标。

Specified by:
lastIndexOf in interface List
Overrides:
lastIndexOf in class AbstractList
Parameters:
elem - the desired component. 期望成员。
Returns:
the index of the last occurrence of the specified object in this vector, that is, the largest value k such that elem.equals(elementData[k]) is true; returns -1 if the object is not found. 指定对象在vector中最后一次出现的位置,即使得elem.equals(elementData[k])为true 的最大值k,如果找不到该对象,返回-1。

<!-- -->

lastIndexOf

public int lastIndexOf(Objectelem,
                       intindex)
Searches backwards for the specified object, starting from the specified index, and returns an index to it. 由指定下标开始,向后查找指定对象,返回对象的下标。

Parameters:
elem - the desired component. 期望成员。
index - the index to start searching from. 起始查找的下标。
Returns:
the index of the last occurrence of the specified object in this vector at position less than or equal to index in the vector, that is, the largest value k such that elem.equals(elementData[k]) && (k <= index) is true; -1 if the object is not found. (Returns -1 if index is negative.) 对象参数在vector中从位置index开始最后一次出现的位置,即使得 elem.equals(elementData[k]) && (k <= index)为true的最大值k, 如果找不到该对象,返回-1。(如果index为负时,返回-1。)
Throws:
IndexOutOfBoundsException - if index is greater than or equal to the current size of this vector. 如果index大于等于vector的当前大小时抛出。

<!-- -->

elementAt

public Object elementAt(intindex)
Returns the component at the specified index. 返回指定下标的成员。

This method is identical in functionality to the get method (which is part of the List interface). 该方法和get方法(List接口的一部分)功能上一致。

Parameters:
index - an index into this vector. vector的一个下标。
Returns:
the component at the specified index. 指定下标的成员。
Throws:
ArrayIndexOutOfBoundsException - if the index is negative or not less than the current size of this Vector object. 如果下标为负或者不小于当前Vector对象的大小时抛出。 given.
See Also:
get(int), List

<!-- -->

firstElement

public Object firstElement()
Returns the first component (the item at index 0) of this vector. 返回vector的第一个成员(下标为0)。

Returns:
the first component of this vector. vector的第一个成员。
Throws:
NoSuchElementException - if this vector has no components. 如果vector没有成员时抛出。

<!-- -->

lastElement

public Object lastElement()
Returns the last component of the vector. 返回vector的最后一个成员。

Returns:
the last component of the vector, i.e., the component at index size()-1. vector的最后一个成员,即下标为size()-1的成员。
Throws:
NoSuchElementException - if this vector is empty. 如果vector为空时抛出。

<!-- -->

setElementAt

public void setElementAt(Objectobj,
                         intindex)
Sets the component at the specified index of this vector to be the specified object. The previous component at that position is discarded. 将vector指定下标的成员设为指定对象。该位置的原成员被丢弃。

The index must be a value greater than or equal to 0 and less than the current size of the vector. index应该大于等于0,而小于等于vector的当前大小。

This method is identical in functionality to the set method (which is part of the List interface). Note that the set method reverses the order of the parameters, to more closely match array usage. Note also that the set method returns the old value that was stored at the specified position. 该方法和set方法(List接口的一部分)功能上一致。注意:set方法颠倒了参数的顺序,更符合数组的用法。 set方法返回指定位置存储的旧值。

Parameters:
obj - what the component is to be set to. 要被设置的成员。
index - the specified index. 指定的下标。
Throws:
ArrayIndexOutOfBoundsException - if the index was invalid. 如果index无效时抛出。
See Also:
size(), List, set(int, java.lang.Object)

<!-- -->

removeElementAt

public void removeElementAt(intindex)
Deletes the component at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously. The size of this vector is decreased by 1. 删除指定下标的成员。vector中每一个下标大于指定index的成员均左移,下标值减1。 vector的大小减1。

The index must be a value greater than or equal to 0 and less than the current size of the vector. index应该大于等于0,而小于等于vector的当前大小。

This method is identical in functionality to the remove method (which is part of the List interface). Note that the remove method returns the old value that was stored at the specified position. 该方法和remove方法(List接口的一部分)功能上一致。注意:remove方法返回指定位置存储的旧值。

Parameters:
index - the index of the object to remove. 要删除对象的下标。
Throws:
ArrayIndexOutOfBoundsException - if the index was invalid.
See Also:
size(), remove(int), List

<!-- -->

insertElementAt

public void insertElementAt(Objectobj,
                            intinde

  


  
分享到:
评论

相关推荐

    java.util.vector中vector小结

    NULL 博文链接:https://corrinejtt.iteye.com/blog/859792

    java.util包

    Java提供日期(Data)类、日历(Calendar)类,随机数(Random)类,堆栈(Stack)、向量(Vector) 、位集合(Bitset)以及哈希表(Hashtable)等类来表示相应的数据结构

    java.util 包 是Java中很大的一个集合

    运用下列类进行JAVA编程: Date Calendar Random 使用 Collection 接口及其实现类 ArrayList LinkedList 使用 HashMap 使用Vector 等方法的使用

    实用工具类库java.util

    介绍Java的实用工具类库java.util包。在这个包中,Java提供了一些实用的方法和数据结构。例如,Java提供日期(Data)类、日历(Calendar)类来产生和获取日期及时间,提供随机数(Random)类产生各种类型的随机数,还提供...

    Java.util包简介并教您如何开发应用之二

    例如,Java提供日期(Data)类、日历(Calendar)类来产生和获取日期及时间,提供随机数(Random)类产生各种类型的随机数,还提供了堆栈(Stack)、向量(Vector)、位集合(Bitset)以及哈希表(Hashtable)等类来表示相应的数据...

    坦克大战java源代码下载

    韩顺平老师讲的坦克大战源代码 坦克大战源码 根据韩顺平老师视频所作 /**坦克大战4.0 * 防重叠 ...import java.util.Vector; public class MyTankGame5 extends JFrame implements ActionListener{

    Java集合多线程安全.docx

    import java.util.ArrayList; import java.util.List; import java.util.UUID; /** * @author: Raicho * @Description: * @program: mianshi * @create: 2020-07-17 15:32 **/ public class ...

    java通讯录

    import java.util.Vector; import java.sql.DriverManager; import java.sql.SQLException; public class DBOperation { private Connection con; public Connection getConnection() { try { Class.for...

    JAVA的名片通讯系统

    import java.util.Vector; public class TelephoneNum { public static void main(String[] args) { TelephoneNumFrame frame = new TelephoneNumFrame();//主界面 frame.setDefaultCloseOperation(JFrame.EXIT_...

    Java Vector 的相关知识

    Java Vector的相关知识 Java Vector的相关知识

    源代码 Java源码 java画图板

    import java.util.*; import java.lang.*; /**the class used to show the image*/ public class DrawPanel extends JPanel { /**store each shape*/ public Vector&lt;ImageInfo&gt; store; /**the creation ...

    java聊天工具源代码

    import java.util.*; import javax.swing.*; import javax.swing.border.TitledBorder; import javax.swing.event.*; public class ChatServer extends JFrame { // used to read Username and Password from ...

    625_agile_java

    ackage devin.wu.readbook.practice; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Vector; p...

    java代码优化简介

    可供程序利用的资源(内存、CPU时间...养成好的代码编写习惯非常重要,比如正确地、巧妙地运用java.lang.String类和java.util.Vector类,它能够显著地提高程序的性能。下面我们就来具体地分析一下这方面的问题。 .....

    Java程序的性能优化StringBuffer与Vector.zip_养 java

    在Java程序中,性能问题的大部分原因并不在于Java语言,而是在于程序本身。养成好的代码编写习惯非常重要,比如正确地、巧妙地运用java.lang.String类和java.util.Vector类,它能够显著地提高程序的性能。

    java代码优化编程

    可供程序利用的资源(内存、CPU时间...养成好的代码编写习惯非常重要,比如正确地、巧妙地运用 java.lang.String类和java.util.Vector类,它能够 显着地提高程序的性能。下面我们就来具体地分析一下这方面的问题。 ……

    基于JAVA的聊天系统的设计于实现

    import java.util.Vector; class ServerThread extends Thread{//继承线程 private Socket socket;//定义套接口 private BufferedReader in;//定义输入流 private PrintWriter out;//定义输出流 int no;//定义...

    学习Java第二十四天–集合框架之泛型集合

    泛型集合12.3.4 泛型集合泛型的场景:定义泛型:12.3.5 Colletions工具类 ...import java.util.Vector; import java.util.ArrayList; import java.util.LinkedList; public class TestBasicGeneric { public s

    建树代码 Java

    // JAVA 新建 一个树的源代码 package com.xiangxiang.frame; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Vector;

    29个要点帮你完成java代码优化

    通过java代码规范来优化程序,优化内存使用...养成好的代码编写习惯非常重要,比如正确地、巧妙地运用java.lang.String类和java.util.Vector类,它能够显著地提高程序的性能。下面我们就来具体地分析一下这方面的问题。

Global site tag (gtag.js) - Google Analytics