(final int start)
| 895 | } |
| 896 | |
| 897 | @Override |
| 898 | public Iterator<IndexValue> getNonZeroIterator(final int start) |
| 899 | { |
| 900 | if(used <= 0) |
| 901 | return Collections.EMPTY_LIST.iterator(); |
| 902 | final int startPos; |
| 903 | if(start <= indexes[0]) |
| 904 | startPos = 0; |
| 905 | else |
| 906 | { |
| 907 | int tmpIndx = Arrays.binarySearch(indexes, 0, used, start); |
| 908 | if(tmpIndx >= 0) |
| 909 | startPos = tmpIndx; |
| 910 | else |
| 911 | startPos = -(tmpIndx)-1; |
| 912 | } |
| 913 | Iterator<IndexValue> itor = new Iterator<IndexValue>() |
| 914 | { |
| 915 | int curUsedPos = startPos; |
| 916 | IndexValue indexValue = new IndexValue(-1, Double.NaN); |
| 917 | |
| 918 | @Override |
| 919 | public boolean hasNext() |
| 920 | { |
| 921 | return curUsedPos < used; |
| 922 | } |
| 923 | |
| 924 | @Override |
| 925 | public IndexValue next() |
| 926 | { |
| 927 | indexValue.setIndex(indexes[curUsedPos]); |
| 928 | indexValue.setValue(values[curUsedPos++]); |
| 929 | return indexValue; |
| 930 | } |
| 931 | |
| 932 | @Override |
| 933 | public void remove() |
| 934 | { |
| 935 | throw new UnsupportedOperationException("Not supported yet."); |
| 936 | } |
| 937 | }; |
| 938 | return itor; |
| 939 | } |
| 940 | |
| 941 | @Override |
| 942 | public int hashCode() |
no test coverage detected