线性表的接口,自己写的
/**
*
*/
package com.liming.list;
/**
* Task 定义线性表共有的操作
* @author LiMing
* @version 1.00
* @since 2013/01/28
*/
public interface ListInterface {
/**
* 向线性表尾部插入数据
* @param o 插入对象
* @return 插入成功返回true ,失败返回false
* */
public boolean add(Object o);
/**
* 向线性表指定位置尾部插入数据
* @param o 插入对象
* @return 插入成功返回true ,失败返回false
* */
public boolean add(int position,Object o);
/**
* 删除线性表指定位置的数据,删除成功返回该数据,否则返回null
* @param position 位置
* @return Object /null
* */
public Object remove(int position);
/**
* 清空整个线性表*/
public boolean clear();
/**
* 替换线性表指定位置的元素
* @param position 替换元素的位置
* @param o 替换数据*/
public boolean replace (int position,Object o);
/**
* 返回指定位置的元素
* @param position 指定位置
* @return 指定位置的元素
* */
public Object getElement(int position);
/**
* 返回指定元素在线性表中的位置
* @param o 需要返回位置的元素
* @return 元素在线性表中的位置*/
public int getIndexOf(Object o);
/**
* 判断该线性表是否包含指定的元素
* @param o 指定的元素
* @return 包含则返回true 否则返回false
* */
public boolean contains(Object o);
/**
* 返回该线性表包含元素的个数
* @return 线性表元素个数的整数
* */
public int length();
/**
* 判断该线性表是否为空
* @return 如果线性表为空则返回true 否则返回false
* */
public boolean isEmpty();
/**
* 判断线性表是否已满
* @return 如果已满返回true 否则返回false
* */
public boolean isFull();
/**
* 按照元素在线性表中的位置进行输出*/
public void diaplay();
}