MCPcopy Index your code
hub / github.com/clojure/clojure / createFromObject

Method createFromObject

src/jvm/clojure/lang/ArrayIter.java:36–57  ·  view source on GitHub ↗
(Object array)

Source from the content-addressed store, hash-verified

34}
35
36static public Iterator createFromObject(Object array){
37 if(array == null || Array.getLength(array) == 0)
38 return EMPTY_ITERATOR;
39 Class aclass = array.getClass();
40 if(aclass == int[].class)
41 return new ArrayIter_int((int[]) array, 0);
42 if(aclass == float[].class)
43 return new ArrayIter_float((float[]) array, 0);
44 if(aclass == double[].class)
45 return new ArrayIter_double((double[]) array, 0);
46 if(aclass == long[].class)
47 return new ArrayIter_long((long[]) array, 0);
48 if(aclass == byte[].class)
49 return new ArrayIter_byte((byte[]) array, 0);
50 if(aclass == char[].class)
51 return new ArrayIter_char((char[]) array, 0);
52 if(aclass == short[].class)
53 return new ArrayIter_short((short[]) array, 0);
54 if(aclass == boolean[].class)
55 return new ArrayIter_boolean((boolean[]) array, 0);
56 return new ArrayIter(array, 0);
57}
58
59ArrayIter(Object array, int i){
60 this.i = i;

Callers 1

iterMethod · 0.95

Calls 1

getLengthMethod · 0.80

Tested by

no test coverage detected