MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / add

Method add

JSAT/src/jsat/utils/SimpleList.java:70–86  ·  view source on GitHub ↗
(int index, E element)

Source from the content-addressed store, hash-verified

68 }
69
70 @Override
71 public void add(int index, E element)
72 {
73 if(index > size())
74 throw new IndexOutOfBoundsException();
75 if(size == source.length)
76 source = Arrays.copyOf(source, size*2);
77
78 if(index == size)
79 source[size++] = element;
80 else
81 {
82 System.arraycopy(source, index, source, index+1, size-index);
83 source[index] = element;
84 size++;
85 }
86 }
87
88 @Override
89 public E remove(int index)

Callers 5

testGetMethod · 0.95
testSizeMethod · 0.95
testAddMethod · 0.95
testSetMethod · 0.95
VPTreeMethod · 0.95

Calls 2

sizeMethod · 0.95
copyOfMethod · 0.80

Tested by 4

testGetMethod · 0.76
testSizeMethod · 0.76
testAddMethod · 0.76
testSetMethod · 0.76