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

coditory / quark-uri / #3

pending completion
#3

push

github-actions

ogesaku
init

1212 of 1212 new or added lines in 21 files covered. (100.0%)

926 of 1212 relevant lines covered (76.4%)

0.76 hits per line

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

52.94
/src/main/java/com/coditory/quark/uri/BitSets.java
1
package com.coditory.quark.uri;
2

3
import org.jetbrains.annotations.NotNull;
4

5
import java.util.BitSet;
6

7
import static com.coditory.quark.uri.Preconditions.expectNonNull;
8

9
final class BitSets {
10
    private BitSets() {
×
11
        throw new UnsupportedOperationException("Do not instantiate utility class");
×
12
    }
13

14
    public static BitSet of(String text) {
15
        expectNonNull(text, "text");
1✔
16
        if (text.length() == 0) {
1✔
17
            return new BitSet(0);
×
18
        }
19
        int max = text.codePoints().max().getAsInt();
1✔
20
        BitSet bitSet = new BitSet(max + 1);
1✔
21
        text.codePoints()
1✔
22
                .forEach(bitSet::set);
1✔
23
        return bitSet;
1✔
24
    }
25

26
    public static BitSet set(BitSet bitSet, int bitIndex, boolean value) {
27
        expectNonNull(bitSet, "bitSet");
1✔
28
        BitSet result = new BitSet(Math.max(bitSet.length(), bitIndex + 1));
1✔
29
        result.or(bitSet);
1✔
30
        result.set(bitIndex, value);
1✔
31
        return result;
1✔
32
    }
33

34
    public static BitSet unmodifiableBitSet(BitSet bitSet) {
35
        expectNonNull(bitSet, "bitSet");
1✔
36
        return new UnmodifiableBitSet(bitSet);
1✔
37
    }
38

39
    static final class UnmodifiableBitSet extends BitSet {
40
        public UnmodifiableBitSet(@NotNull BitSet original) {
1✔
41
            expectNonNull(original, "original");
1✔
42
            super.or(original);
1✔
43
        }
1✔
44

45
        @Override
46
        public void flip(int bitIndex) {
47
            throw new UnsupportedOperationException();
×
48
        }
49

50
        @Override
51
        public void flip(int fromIndex, int toIndex) {
52
            throw new UnsupportedOperationException();
×
53
        }
54

55
        @Override
56
        public void set(int bitIndex) {
57
            throw new UnsupportedOperationException();
×
58
        }
59

60
        @Override
61
        public void set(int bitIndex, boolean value) {
62
            throw new UnsupportedOperationException();
×
63
        }
64

65
        @Override
66
        public void set(int fromIndex, int toIndex) {
67
            throw new UnsupportedOperationException();
×
68
        }
69

70
        @Override
71
        public void set(int fromIndex, int toIndex, boolean value) {
72
            throw new UnsupportedOperationException();
×
73
        }
74

75
        @Override
76
        public void clear(int bitIndex) {
77
            throw new UnsupportedOperationException();
×
78
        }
79

80
        @Override
81
        public void clear(int fromIndex, int toIndex) {
82
            throw new UnsupportedOperationException();
×
83
        }
84

85
        @Override
86
        public void clear() {
87
            throw new UnsupportedOperationException();
×
88
        }
89

90
        @Override
91
        public void and(@NotNull BitSet set) {
92
            throw new UnsupportedOperationException();
×
93
        }
94

95
        @Override
96
        public void or(@NotNull BitSet set) {
97
            throw new UnsupportedOperationException();
×
98
        }
99

100
        @Override
101
        public void xor(@NotNull BitSet set) {
102
            throw new UnsupportedOperationException();
×
103
        }
104

105
        @Override
106
        public void andNot(@NotNull BitSet set) {
107
            throw new UnsupportedOperationException();
×
108
        }
109
    }
110
}
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

© 2025 Coveralls, Inc