当前位置: 首页>>代码示例>>Java>>正文


Java ArrayList.addAll方法代码示例

本文整理汇总了Java中java.util.ArrayList.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayList.addAll方法的具体用法?Java ArrayList.addAll怎么用?Java ArrayList.addAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.ArrayList的用法示例。


在下文中一共展示了ArrayList.addAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doShortcut

import java.util.ArrayList; //导入方法依赖的package包/类
public void doShortcut() {

        setContentView(R.layout.activity_setup_widget);
        setupAppBar(R.id.toolbar, R.string.widget_creation_title, true, true);
        header = getLayoutInflater().inflate(R.layout.widget_header, null);

        ListView list = (ListView) findViewById(R.id.subs);
        final ArrayList<FeedWrapper> sorted = new ArrayList<FeedWrapper>(Realm.getDefaultInstance().where(Feed.class).findAllSorted("order"));
        sorted.addAll(Realm.getDefaultInstance().where(Category.class).findAllSorted("order"));
        Collections.sort(sorted, new Comparator<FeedWrapper>() {
            @Override
            public int compare(FeedWrapper p1, FeedWrapper p2) {
                return p1.getOrder() - p2.getOrder();// Ascending
            }

        });
        final SideArrayAdapter adapter = new SideArrayAdapter(this, sorted, list);

        list.addHeaderView(header);
        list.setAdapter(adapter);
    }
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:22,代码来源:SetupWidget.java

示例2: serialize

import java.util.ArrayList; //导入方法依赖的package包/类
@Override
public Map<String, Object> serialize() {
	Map<String, Object> map = new HashMap<String, Object>();
       map.put("craft", this.craft);
       HashMap<ItemStack, Integer> ofresult = this.result;
       ArrayList<ItemStack> seresult = new ArrayList<ItemStack>();
       seresult.addAll(ofresult.keySet());
       map.put("result.items", seresult);
       ArrayList<Integer> seresultprobs = new ArrayList<Integer>();
       seresultprobs.addAll(ofresult.values());
       map.put("result.probs", seresultprobs);
       map.put("cmds", this.cmds);
       map.put("redstonepower", this.redstonepower);
       map.put("experience", this.experience);
       return map;
}
 
开发者ID:Slaymd,项目名称:CaulCrafting,代码行数:17,代码来源:CraftArray.java

示例3: provideReadWriteRanges

import java.util.ArrayList; //导入方法依赖的package包/类
@Override
public List<ReadWriteRange> provideReadWriteRanges(Bus.BusType busType) {
    ArrayList<ReadWriteRange> readWriteRanges = new ArrayList<ReadWriteRange>();
    switch (busType) {
        case CPU:
            readWriteRanges.add(swappableRoms);
            readWriteRanges.add(fixedRom);
            break;
        case PPU:
            readWriteRanges.add(chrRam);
            readWriteRanges.addAll(nameTableRams);
            readWriteRanges.add(paletteRam);
            break;
    }
    return readWriteRanges;
}
 
开发者ID:gradualgames,项目名称:ggvm,代码行数:17,代码来源:Mapper30.java

示例4: getAttributesWithValue

import java.util.ArrayList; //导入方法依赖的package包/类
public ArrayList<String> getAttributesWithValue(String csParameterName, String csOptionalPrefixed)
{
	ArrayList<String> arrs = null; 
	int n  = 0;
	String csName = getName();
	ValCursor cur = new ValCursor(); 
	String csValue = getFirstNamedVal(cur, csParameterName);
	while(csValue != null)
	{
		ArrayList<String> arr = StringUtil.extractPrefixedKeywords(csValue, csOptionalPrefixed);
		if(arr != null)
		{
			if(arrs == null)
				arrs = new ArrayList<String>();
			arrs.addAll(arr);
		}
		csValue = getNextNamedVal(cur,  csParameterName);
	}
	return arrs; 
}
 
开发者ID:costea7,项目名称:ChronoBike,代码行数:21,代码来源:Tag.java

示例5: ShopItem

import java.util.ArrayList; //导入方法依赖的package包/类
public ShopItem(String id, int cost, String unit) {
    if (ItemManager.itemIdentifierToRPGItemMap.containsKey(id)) {
        this.item = ItemManager.itemIdentifierToRPGItemMap.get(id).generate();
        this.cost = cost;
        ItemStack temp = new ItemStack(item.getType());
        ArrayList<String> lore = new ArrayList<String>();
        if (temp.hasItemMeta() && temp.getItemMeta().hasLore())
            lore.addAll(temp.getItemMeta().getLore());
        lore.add("");
        lore.add(ChatColor.GRAY + "Click to buy this item for " + ChatColor.YELLOW + cost + " " + unit + ChatColor.GRAY + ".");
        ItemMeta im = temp.getItemMeta();
        im.setDisplayName(item.hasItemMeta() && item.getItemMeta().hasDisplayName() ? item.getItemMeta().getDisplayName() : item.getType().toString());
        im.setLore(lore);
        temp.setItemMeta(im);
        display = temp;
    } else {
        try {
            throw new Exception("Could not load shop item with id " + id + " and cost " + cost);
        } catch (Exception e) {
            e.printStackTrace();
        }
        this.item = null;
        this.cost = -1;
        this.display = null;
    }
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:27,代码来源:ShopItem.java

示例6: collectCells

import java.util.ArrayList; //导入方法依赖的package包/类
protected ArrayList<Object> collectCells() {
    ArrayList<Object> cells = new ArrayList<Object>();

    Platform[] platforms = ShareSDK.getPlatformList();
    if (platforms == null) {
        platforms = new Platform[0];
    }
    HashMap<String, String> hides = getHiddenPlatforms();
    if (hides == null) {
        hides = new HashMap<String, String>();
    }
    for (Platform p : platforms) {
        if (!hides.containsKey(p.getName())) {
            cells.add(p);
        }
    }

    ArrayList<CustomerLogo> customers = getCustomerLogos();
    if (customers != null && customers.size() > 0) {
        cells.addAll(customers);
    }

    return cells;
}
 
开发者ID:gaolhjy,项目名称:cniao5,代码行数:25,代码来源:PlatformPage.java

示例7: getLaunchArguments

import java.util.ArrayList; //导入方法依赖的package包/类
@Override
public String[] getLaunchArguments() {
    ArrayList args = (ArrayList)Launch.blackboard.get("ArgumentList");
    if(args.isEmpty()) args.addAll(this.args);

    this.args = null;

    return new String[0];
}
 
开发者ID:Guichaguri,项目名称:BOHA,代码行数:10,代码来源:BlockerTweak.java

示例8: createPluginFactory

import java.util.ArrayList; //导入方法依赖的package包/类
protected PluginFactory createPluginFactory(List<PluginProvider> list) {
    ArrayList<Plugin> plugins = new ArrayList<Plugin>();

    for (PluginProvider suit : list) {
        plugins.addAll(suit.getPlugins());
    }

    plugins.add(new AbstractPlugin() {

        @Override
        public String getName() {
            return "Log";
        }

        @Override
        public Class getFunctionalInterface() {
            return ILog.class;
        }

        @Override
        public Object createFunctionalInterfaceObject(Engine engine,
                                                      IEngine iEngine) {
            return log;
        }
    });

    PluginFactory factory = new PluginFactory(plugins);
    return factory;
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:30,代码来源:EngineFactory.java

示例9: putAll

import java.util.ArrayList; //导入方法依赖的package包/类
public void putAll(Map< ? extends String, ? extends List<V>> mapToPut) {
    for (String k : mapToPut.keySet()) {
        ArrayList<V> al = new ArrayList<V>();
        al.addAll(mapToPut.get(k));
        getMap().put(k, al);
    }  
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:8,代码来源:MultiValueMapImpl.java

示例10: copy

import java.util.ArrayList; //导入方法依赖的package包/类
private GUIElement copy(GUIElement object) {
    GUIElement clone = (GUIElement) object.clone();
    ArrayList events = new ArrayList(  );
    events.addAll( object.getEvents() );
    clone.setEvents( events );
    return clone;
}
 
开发者ID:LegendOnline,项目名称:InventoryAPI,代码行数:8,代码来源:ModelLayout.java

示例11: getAllParentMixins

import java.util.ArrayList; //导入方法依赖的package包/类
public static ArrayList<Mixin> getAllParentMixins(Mixin m) {
	ArrayList<Mixin> mixins = new ArrayList<Mixin>();
	for (Mixin m1 : m.getDepends()) {
		mixins.add(m1);
		mixins.addAll(getAllParentMixins(m1));
	}
	return mixins;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:9,代码来源:GenUtils.java

示例12: getOrderedChildren

import java.util.ArrayList; //导入方法依赖的package包/类
/** {@inheritDoc} */
public List<XMLObject> getOrderedChildren() {
    ArrayList<XMLObject> children = new ArrayList<XMLObject>();

    if (textContent == null) {
        children.addAll(unknownElements);
    }

    return Collections.unmodifiableList(children);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:AttributeValueTypeImpl.java

示例13: removeChannels

import java.util.ArrayList; //导入方法依赖的package包/类
private void removeChannels(ChannelTypeUID channelType) {
    List<Channel> channelList = thing.getChannels();
    ArrayList<Channel> mutableChannelList = new ArrayList<Channel>();
    mutableChannelList.addAll(channelList);
    for (int i = 0; i < mutableChannelList.size(); i++) {
        if (mutableChannelList.get(i).getChannelTypeUID().equals(channelType)) {
            mutableChannelList.remove(i);
            i = 0;
        }
    }

    ThingBuilder thingBuilder = editThing();
    thingBuilder.withChannels(mutableChannelList);
    updateThing(thingBuilder.build());
}
 
开发者ID:Wire82,项目名称:org.openhab.binding.heos,代码行数:16,代码来源:HeosBridgeHandler.java

示例14: getOrderedChildren

import java.util.ArrayList; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
public List<XMLObject> getOrderedChildren() {
    ArrayList<XMLObject> children = new ArrayList<XMLObject>();

    children.addAll(super.getOrderedChildren());
    children.add(protocolMessage);

    return Collections.unmodifiableList(children);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:ArtifactResponseImpl.java

示例15: resume

import java.util.ArrayList; //导入方法依赖的package包/类
@Override
public void resume(ExecutionContext context, Object suspendedState)
    throws ResolvedControlThrowable {
  // success: prepend true
  ReturnBuffer rbuf = context.getReturnBuffer();
  ArrayList<Object> result = new ArrayList<>();
  result.add(Boolean.TRUE);
  result.addAll(Arrays.asList(rbuf.getAsArray()));
  rbuf.setToContentsOf(result);
}
 
开发者ID:kroepke,项目名称:luna,代码行数:11,代码来源:BasicLib.java


注:本文中的java.util.ArrayList.addAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。