MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / grab

Method grab

patterns/recyclec/RecycleC.java:17–25  ·  view source on GitHub ↗
(Trash t)

Source from the content-addressed store, hash-verified

15 this.binType = binType;
16 }
17 @SuppressWarnings("unchecked")
18 boolean grab(Trash t) {
19 // Compare class types:
20 if(t.getClass().equals(binType)) {
21 add((T)t); // Downcast to this TrashBin type
22 return true; // Trash grabbed
23 }
24 return false; // Trash not grabbed
25 }
26}
27
28class TrashBinList<T extends Trash>

Callers 1

sortMethod · 0.80

Calls 2

equalsMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected