本文整理汇总了Java中java.util.AbstractList.add方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractList.add方法的具体用法?Java AbstractList.add怎么用?Java AbstractList.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.AbstractList
的用法示例。
在下文中一共展示了AbstractList.add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetRecentConnections
import java.util.AbstractList; //导入方法依赖的package包/类
public void testGetRecentConnections() throws Exception {
String section = "remote.platforms";
ExecutionEnvironment[] envs = NativeExecutionTestSupport.getTestExecutionEnvironmentsFromSection(section);
assertTrue("Empty environmens list for section ", envs.length > 0);
ConnectionManager.getInstance().clearRecentConnectionsList();
AbstractList<ExecutionEnvironment> referenceList = new ArrayList<>();
for (ExecutionEnvironment env : envs) {
ConnectionManager.getInstance().updateRecentConnectionsList(env);
referenceList.add(0, env);
}
List<ExecutionEnvironment> managersList = ConnectionManager.getInstance().getRecentConnections();
assertEquals("Connections lists differ", referenceList, managersList);
ConnectionManager.getInstance().clearRecentConnectionsList();
assertTrue("Recent connections list should be empty", ConnectionManager.getInstance().getRecentConnections().isEmpty());
ConnectionManager.getInstance().restoreRecentConnectionsList();
assertEquals("Restopred connections list differ", referenceList, managersList);
}
示例2: onSearch
import java.util.AbstractList; //导入方法依赖的package包/类
public void onSearch(String s) {
search = s;
if (mAdapter != null) {
if (TextUtils.isEmpty(s)) {
mAdapter.clear();
mAdapter.setIcons(randomize, icons);
mAdapter.notifyDataSetChanged();
} else {
AbstractList<String> tmpList = new ArrayList<>();
for (String icon : icons) {
if (icon.toLowerCase().contains(s.toLowerCase())) {
tmpList.add(icon);
}
}
mAdapter.clear();
mAdapter.setIcons(randomize, tmpList);
mAdapter.notifyDataSetChanged();
}
}
}
示例3: withSameOrigin
import java.util.AbstractList; //导入方法依赖的package包/类
/**
*
* @return
*/
protected AbstractList<HalfEdge> withSameOrigin() {
AbstractList<HalfEdge> result = new LinkedList<>();
HalfEdge current = this;
do {
current = current.twin.next;
result.add(current);
} while (!this.equals(current));
return result;
}