?? vector.java
字號(hào):
/*
Netwar
Copyright (C) 2002 Daniel Grund, Kyle Kakligian, Jason Komutrattananon, & Brian Hibler.
This file is part of Netwar.
Netwar is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Netwar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Netwar; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package netwar.utils;
/** Vector ADT, interface.
* @author Kyle Kakligian
*/
public interface Vector {
/** Remove all Objects from the list.
*/
public void clear();
/** Insert an Object at the current position.
* @param item Object to add.
*/
public void insert(Object item);
/** Insert an Object at the tail of the list.
* @param item Object to append.
*/
public void append(Object item);
/** Removes and returns the current Object of the list.
* @return Object just removed.
*/
public Object remove();
/** Sets the current Object to the first one in the list.
*/
public void goFirst();
/** Sets the current Object to the next one in the list.
*/
public void goNext();
/** Sets the current Object to the previous one in the list.
*/
public void goPrev();
/** Returns the number of Objects in the list.
* @return The number of Objects in the list.
*/
public int getLength();
/** Sets the current Object to the given index.
* @param pos The index to move to.
*/
public void go(int pos);
/** Sets the current Object's value: a reference.
* @param val The reference to set this list entre to.
*/
public void set(Object val);
/** Gets the current Object's value.
* @return The reference for the current Object. Note, you will probably need to cast.
*/
public Object get();
/** Returns whether or not the list is empty.
* @return true if a null list.
*/
public boolean isEmpty();
/** Returns true if the current pointer is valid.
* @return true if the current pointer points within the list.
*/
public boolean isInList();
/** Resizes the internal stucture to use the least amount or memory.
*/
public void shrink();
/** Resizes the internal stucture to hold at least the given numer of objects.
* @param sz The minumum number of Objects to hold.
*/
public void resize(int sz);
} // interface Vector
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -