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

📄 viewutils.java

📁 库存管理系统:这是在Eclipse环境下开发的
💻 JAVA
字号:
package cn.hxex.library.view.util;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

public class ViewUtils
{
	/**
	 * Convert a list to a set.
	 * 
	 * @param orig
	 *            the list to be converted
	 * @return the set converted from the list
	 */
	public static Set convertToSet(List orig)
	{
		Set result = new HashSet();

		if (orig != null)
		{
			Iterator ite = orig.iterator();

			while (ite.hasNext())
			{
				result.add(ite.next());
			}
		}

		return result;
	}

	/**
	 * Convert a set to a list.
	 * 
	 * @param orig
	 *            the set to be converted
	 * @return the list converted from the set
	 */
	public static List convertToList(Set orig)
	{
		List result = new ArrayList();

		if (orig != null)
		{
			Iterator ite = orig.iterator();

			while (ite.hasNext())
			{
				result.add(ite.next());
			}
		}

		return result;
	}
}

⌨️ 快捷键说明

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