MCPcopy Create free account
hub / github.com/Card-Forge/forge / createFrom

Method createFrom

forge-core/src/main/java/forge/util/ItemPool.java:46–58  ·  view source on GitHub ↗
(final ItemPool<Tin> from, final Class<Tout> clsHint)

Source from the content-addressed store, hash-verified

44 }
45
46 @SuppressWarnings("unchecked")
47 public static <Tin extends InventoryItem, Tout extends InventoryItem> ItemPool<Tout> createFrom(final ItemPool<Tin> from, final Class<Tout> clsHint) {
48 final ItemPool<Tout> result = new ItemPool<>(clsHint);
49 if (from != null) {
50 for (final Entry<Tin, Integer> e : from) {
51 final Tin srcKey = e.getKey();
52 if (clsHint.isInstance(srcKey)) {
53 result.add((Tout) srcKey, e.getValue());
54 }
55 }
56 }
57 return result;
58 }
59
60 @SuppressWarnings("unchecked")
61 public static <Tin extends InventoryItem, Tout extends InventoryItem> ItemPool<Tout> createFrom(final Iterable<Tin> from, final Class<Tout> clsHint) {

Callers 13

setPoolMethod · 0.95
FModelClass · 0.95
parseMethod · 0.95
getCommanderDecksMethod · 0.95
getBrawlDecksMethod · 0.95
CEditorConstructedMethod · 0.95
analyzeMethod · 0.95
CEditorCommanderMethod · 0.95
analyzeMethod · 0.95
VWorkshopCatalogMethod · 0.95
setPoolMethod · 0.95

Calls 4

addMethod · 0.95
isInstanceMethod · 0.80
getKeyMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected