MCPcopy Index your code
hub / github.com/EdwardRaff/JSAT / addAll

Method addAll

JSAT/src/jsat/utils/SortedArrayList.java:76–94  ·  view source on GitHub ↗
(Collection<? extends T> c)

Source from the content-addressed store, hash-verified

74 }
75
76 @Override
77 public boolean addAll(Collection<? extends T> c)
78 {
79 if(c.isEmpty())
80 return false;
81 else if(c.size() > this.size()*3/2)//heuristic when is it faster to just add them all and sort the whole thing?
82 {
83 boolean did = super.addAll(c);
84 if(did)
85 Collections.sort(this);
86 return did;
87 }
88 else
89 {
90 for(T t : c)
91 this.add(t);
92 return true;
93 }
94 }
95
96 @Override
97 public boolean addAll(int index, Collection<? extends T> c)

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
sizeMethod · 0.65
sortMethod · 0.45

Tested by

no test coverage detected