• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

leeonky / test-charm-java / 218

15 Apr 2025 02:45PM UTC coverage: 74.045% (-0.04%) from 74.088%
218

push

circleci

leeonky
Introduce adaptiveList

20 of 21 new or added lines in 3 files covered. (95.24%)

34 existing lines in 11 files now uncovered.

7968 of 10761 relevant lines covered (74.05%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.89
/DAL-java/src/main/java/com/github/leeonky/dal/runtime/DALCollection.java
1
package com.github.leeonky.dal.runtime;
2

3
import com.github.leeonky.dal.IndexedElement;
4

5
import java.util.Iterator;
6
import java.util.List;
7
import java.util.Spliterators;
8
import java.util.function.Predicate;
9
import java.util.stream.Stream;
10

11
public interface DALCollection<E> extends Iterable<IndexedElement<E>> {
12
    int size();
13

14
    E getByIndex(int index);
15

16
    int firstIndex();
17

18
    DALCollection<E> requireLimitedCollection(String message);
19

20
    List<E> collect();
21

22
    default DALCollection<E> filter(Predicate<E> predicate) {
23
        return new IterableDALCollection<E>(() -> Spliterators.iterator(values().filter(predicate).spliterator())) {
×
24
            @Override
25
            public int firstIndex() {
26
                return DALCollection.this.firstIndex();
×
27
            }
28
        };
29
    }
30

31
    Stream<E> values();
32

33
    Stream<Integer> indexes();
34

35
    <R> DALCollection<R> map(IndexedElement.Mapper<? super E, ? extends R> mapper);
36

37
    Stream<IndexedElement<E>> stream();
38

39
    boolean infinite();
40

41
    DALCollection<Object> limit(int size);
42

43
    class Decorated<E> implements DALCollection<E> {
44

45
        private final DALCollection<E> origin;
46

47
        public Decorated(DALCollection<E> origin) {
1✔
48
            this.origin = origin;
1✔
49
        }
1✔
50

51
        @Override
52
        public int size() {
53
            return origin.size();
1✔
54
        }
55

56
        @Override
57
        public E getByIndex(int index) {
58
            return origin.getByIndex(index);
1✔
59
        }
60

61
        @Override
62
        public Iterator<IndexedElement<E>> iterator() {
UNCOV
63
            return origin.iterator();
×
64
        }
65

66
        @Override
67
        public int firstIndex() {
68
            return origin.firstIndex();
1✔
69
        }
70

71
        @Override
72
        public List<E> collect() {
73
            return origin.collect();
1✔
74
        }
75

76
        @Override
77
        public DALCollection<E> filter(Predicate<E> predicate) {
78
            return origin.filter(predicate);
1✔
79
        }
80

81
        @Override
82
        public boolean infinite() {
83
            return origin.infinite();
1✔
84
        }
85

86
        @Override
87
        public DALCollection<Object> limit(int size) {
88
            return origin.limit(size);
×
89
        }
90

91
        @Override
92
        public Stream<E> values() {
93
            return origin.values();
×
94
        }
95

96
        @Override
97
        public Stream<Integer> indexes() {
98
            return origin.indexes();
1✔
99
        }
100

101
        @Override
102
        public <R> DALCollection<R> map(IndexedElement.Mapper<? super E, ? extends R> mapper) {
103
            return origin.map(mapper);
1✔
104
        }
105

106
        @Override
107
        public Stream<IndexedElement<E>> stream() {
108
            return origin.stream();
×
109
        }
110

111
        @Override
112
        public Decorated<E> requireLimitedCollection(String message) {
113
            origin.requireLimitedCollection(message);
×
114
            return this;
×
115
        }
116
    }
117
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc