⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sortedlist.java

📁 库存管理系统 采用JAVA来编写 希望对学习JAVA 的同学有所帮助
💻 JAVA
字号:
package merchant;

public class SortedList extends List{
	private Comparable comp;
	//constructor
	public SortedList(Comparable comp1)
	{
		comp=comp1;
	}
	public SortedList(int max_Items,Comparable comp2)
	{
		super(max_Items);
		comp=comp2;
	}
	public void add(Object obj)
	{
		super.add(obj);
		FlexSorter.sort(list,getSize(),comp);
	}
	public int indexOf(Object obj)
	{
		for(int i=0;i<getSize();i++)
		{
			if(comp.compare(get(i), obj)==0)
				return 1;
		}
		return -1;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -