viewutils.java
来自「Hibernate (著译者: 陈天河等)项目开发宝典本书以Hibernate为」· Java 代码 · 共 59 行
JAVA
59 行
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 + =
减小字号Ctrl + -
显示快捷键?