📄 viewutils.java
字号:
/*
* JCatalog Project
*/
package catalog.view.util;
import java.util.Set;
import java.util.HashSet;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
/**
* Utility class for the presentation tier.
*
* @author <a href="mailto:derek_shen@hotmail.com">Derek Y. Shen</a>
*/
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 + -