Skip to content

Commit 99d70f4

Browse files
committed
🚌 w/ javadoc links
1 parent 815aa16 commit 99d70f4

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>io.github.javaf</groupId>
77
<artifactId>extra-bit</artifactId>
8-
<version>1.0.3</version>
8+
<version>1.0.4</version>
99
<packaging>jar</packaging>
1010

1111
<!-- Use JDK 11 -->

src/main/java/io/github/javaf/Bit.java

+44-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
/**
77
* The bit is a basic unit of information in information theory, computing.
88
* This package includes bit twiddling hacks by Sean Eron Anderson and many
9-
* others.
9+
* others.<br>
10+
* 📦 <a href="https://search.maven.org/artifact/io.github.javaf/extra-bit">Central</a>,
11+
* 📜 <a href="https://repo1.maven.org/maven2/io/github/javaf/extra-bit/">Releases</a>,
12+
* 😺 <a href="https://github.com/javaf/hello-world/packages/579834">GitHub</a>,
13+
* 🐸 <a href="https://bintray.com/beta/#/bintray/jcenter/io.github.javaf:extra-bit">Bintray</a>,
14+
* 🦚 <a href="https://mvnrepository.com/artifact/io.github.javaf/extra-bit">MvnRepository</a>,
15+
* 📰 <a href="https://javaf.github.io/extra-bit/">Javadoc</a>,
16+
* 📘 <a href="https://github.com/javaf/extra-bit/wiki">Wiki</a>.
1017
*/
1118
public final class Bit {
1219

@@ -27,6 +34,7 @@ public final class Bit {
2734
// GET*, SET*, TOGGLE*, SWAP
2835
/**
2936
* Get a bit.
37+
* <a href="https://github.com/javaf/extra-boolean/wiki/get">📘</a>
3038
* @param x an int
3139
* @param i bit index
3240
* @return bit
@@ -37,6 +45,7 @@ public static int get(int x, int i) {
3745

3846
/**
3947
* Get a bit.
48+
* <a href="https://github.com/javaf/extra-boolean/wiki/get">📘</a>
4049
* @param x a long
4150
* @param i bit index
4251
* @return bit
@@ -49,6 +58,7 @@ public static int get(long x, int i) {
4958

5059
/**
5160
* Get bits as per mask.
61+
* <a href="https://github.com/javaf/extra-boolean/wiki/getAs">📘</a>
5262
* @param x an int
5363
* @param m bit mask
5464
* @return bits
@@ -59,6 +69,7 @@ public static int getAs(int x, int m) {
5969

6070
/**
6171
* Get bits as per mask.
72+
* <a href="https://github.com/javaf/extra-boolean/wiki/getAs">📘</a>
6273
* @param x a long
6374
* @param m bit mask
6475
* @return bits
@@ -71,6 +82,7 @@ public static long getAs(long x, long m) {
7182

7283
/**
7384
* Set a bit.
85+
* <a href="https://github.com/javaf/extra-boolean/wiki/set">📘</a>
7486
* @param x an int
7587
* @param i bit index
7688
* @param f bit value (1)
@@ -82,6 +94,7 @@ public static int set(int x, int i, int f) {
8294

8395
/**
8496
* Set a bit.
97+
* <a href="https://github.com/javaf/extra-boolean/wiki/set">📘</a>
8598
* @param x a long
8699
* @param i bit index
87100
* @param f bit value (1)
@@ -95,6 +108,7 @@ public static long set(long x, int i, int f) {
95108

96109
/**
97110
* Set bits as per mask.
111+
* <a href="https://github.com/javaf/extra-boolean/wiki/setAs">📘</a>
98112
* @param x an int
99113
* @param m bit mask
100114
* @param f bit value (1)
@@ -106,6 +120,7 @@ public static int setAs(int x, int m, int f) {
106120

107121
/**
108122
* Set bits as per mask.
123+
* <a href="https://github.com/javaf/extra-boolean/wiki/setAs">📘</a>
109124
* @param x a long
110125
* @param m bit mask
111126
* @param f bit value (1)
@@ -119,6 +134,7 @@ public static long setAs(long x, long m, int f) {
119134

120135
/**
121136
* Toggle a bit.
137+
* <a href="https://github.com/javaf/extra-boolean/wiki/toggle">📘</a>
122138
* @param x an int
123139
* @param i bit index
124140
* @return toggled int
@@ -129,6 +145,7 @@ public static int toggle(int x, int i) {
129145

130146
/**
131147
* Toggle a bit.
148+
* <a href="https://github.com/javaf/extra-boolean/wiki/toggle">📘</a>
132149
* @param x a long
133150
* @param i bit index
134151
* @return toggled long
@@ -141,6 +158,7 @@ public static long toggle(long x, int i) {
141158

142159
/**
143160
* Toggle bits as per mask.
161+
* <a href="https://github.com/javaf/extra-boolean/wiki/toggleAs">📘</a>
144162
* @param x an int
145163
* @param m bit mask
146164
* @return toggled int
@@ -151,6 +169,7 @@ public static int toggleAs(int x, int m) {
151169

152170
/**
153171
* Toggle bits as per mask.
172+
* <a href="https://github.com/javaf/extra-boolean/wiki/toggleAs">📘</a>
154173
* @param x a long
155174
* @param m bit mask
156175
* @return toggled long
@@ -163,6 +182,7 @@ public static long toggleAs(long x, long m) {
163182

164183
/**
165184
* Swap bits.
185+
* <a href="https://github.com/javaf/extra-boolean/wiki/swap">📘</a>
166186
* @param x an int
167187
* @param i first bit index
168188
* @param j second bit index
@@ -175,6 +195,7 @@ public static int swap(int x, int i, int j) {
175195

176196
/**
177197
* Swap bits.
198+
* <a href="https://github.com/javaf/extra-boolean/wiki/swap">📘</a>
178199
* @param x a long
179200
* @param i first bit index
180201
* @param j second bit index
@@ -187,6 +208,7 @@ public static long swap(long x, int i, int j) {
187208

188209
/**
189210
* Swap bit sequences.
211+
* <a href="https://github.com/javaf/extra-boolean/wiki/swap">📘</a>
190212
* @param x an int
191213
* @param i first bit index
192214
* @param j second bit index
@@ -200,6 +222,7 @@ public static int swap(int x, int i, int j, int n) {
200222

201223
/**
202224
* Swap bit sequences.
225+
* <a href="https://github.com/javaf/extra-boolean/wiki/swap">📘</a>
203226
* @param x a long
204227
* @param i first bit index
205228
* @param j second bit index
@@ -217,6 +240,7 @@ public static long swap(long x, int i, int j, int n) {
217240
// COUNT, PARITY, SCAN*
218241
/**
219242
* Count bits set.
243+
* <a href="https://github.com/javaf/extra-boolean/wiki/count">📘</a>
220244
* @param x an int
221245
* @return count
222246
*/
@@ -228,6 +252,7 @@ public static int count(int x) {
228252

229253
/**
230254
* Count bits set.
255+
* <a href="https://github.com/javaf/extra-boolean/wiki/count">📘</a>
231256
* @param x a long
232257
* @return count
233258
*/
@@ -242,6 +267,7 @@ public static int count(long x) {
242267

243268
/**
244269
* Get 1-bit parity.
270+
* <a href="https://github.com/javaf/extra-boolean/wiki/parity">📘</a>
245271
* @param x an int
246272
* @return parity
247273
*/
@@ -255,6 +281,7 @@ public static int parity(int x) {
255281

256282
/**
257283
* Get 1-bit parity.
284+
* <a href="https://github.com/javaf/extra-boolean/wiki/parity">📘</a>
258285
* @param x a long
259286
* @return parity
260287
*/
@@ -269,6 +296,7 @@ public static int parity(long x) {
269296

270297
/**
271298
* Get n-bit parity.
299+
* <a href="https://github.com/javaf/extra-boolean/wiki/parity">📘</a>
272300
* @param x an int
273301
* @param n number of bits (1)
274302
* @return parity
@@ -285,6 +313,7 @@ public static int parity(int x, int n) {
285313

286314
/**
287315
* Get n-bit parity.
316+
* <a href="https://github.com/javaf/extra-boolean/wiki/parity">📘</a>
288317
* @param x an int
289318
* @param n number of bits (1)
290319
* @return parity
@@ -303,6 +332,7 @@ public static int parity(long x, int n) {
303332

304333
/**
305334
* Get index of first set bit from LSB.
335+
* <a href="https://github.com/javaf/extra-boolean/wiki/scan">📘</a>
306336
* @param x an int
307337
* @return bit index
308338
*/
@@ -312,6 +342,7 @@ public static int scan(int x) {
312342

313343
/**
314344
* Get index of first set bit from LSB.
345+
* <a href="https://github.com/javaf/extra-boolean/wiki/scan">📘</a>
315346
* @param x a long
316347
* @return bit index
317348
*/
@@ -325,6 +356,7 @@ public static int scan(long x) {
325356

326357
/**
327358
* Get index of first set bit from MSB.
359+
* <a href="https://github.com/javaf/extra-boolean/wiki/scanReverse">📘</a>
328360
* @param x an int32
329361
* @return bit index
330362
*/
@@ -339,6 +371,7 @@ public static int scanReverse(int x) {
339371

340372
/**
341373
* Get index of first set bit from LSB.
374+
* <a href="https://github.com/javaf/extra-boolean/wiki/scanReverse">📘</a>
342375
* @param x a long
343376
* @return bit index
344377
*/
@@ -354,6 +387,7 @@ public static int scanReverse(long x) {
354387
// MERGE, INTERLEAVE, ROTATE, REVERSE, SIGNEXTEND
355388
/**
356389
* Merge bits as per mask.
390+
* <a href="https://github.com/javaf/extra-boolean/wiki/merge">📘</a>
357391
* @param x first int
358392
* @param y second int
359393
* @param m bit mask (0 ⇒ from x)
@@ -365,6 +399,7 @@ public static int merge(int x, int y, int m) {
365399

366400
/**
367401
* Merge bits as per mask.
402+
* <a href="https://github.com/javaf/extra-boolean/wiki/merge">📘</a>
368403
* @param x first long
369404
* @param y second long
370405
* @param m bit mask (0 ⇒ from x)
@@ -378,6 +413,7 @@ public static long merge(long x, long y, long m) {
378413

379414
/**
380415
* Interleave bits of two shorts.
416+
* <a href="https://github.com/javaf/extra-boolean/wiki/interleave">📘</a>
381417
* @param x first short
382418
* @param y second short
383419
* @return int
@@ -396,6 +432,7 @@ public static int interleave(int x, int y) {
396432

397433
/**
398434
* Interleave bits of two ints.
435+
* <a href="https://github.com/javaf/extra-boolean/wiki/interleave">📘</a>
399436
* @param x first int
400437
* @param y second int
401438
* @return interleaved long
@@ -418,6 +455,7 @@ public static long interleave(long x, long y) {
418455

419456
/**
420457
* Rotate bits.
458+
* <a href="https://github.com/javaf/extra-boolean/wiki/rotate">📘</a>
421459
* @param x an int
422460
* @param n rotate amount (+ve: left, -ve: right)
423461
* @return rotated int
@@ -428,6 +466,7 @@ public static int rotate(int x, int n) {
428466

429467
/**
430468
* Rotate bits.
469+
* <a href="https://github.com/javaf/extra-boolean/wiki/rotate">📘</a>
431470
* @param x a long
432471
* @param n rotate amount (+ve: left, -ve: right)
433472
* @return rotated long
@@ -440,6 +479,7 @@ public static long rotate(long x, int n) {
440479

441480
/**
442481
* Reverse all bits.
482+
* <a href="https://github.com/javaf/extra-boolean/wiki/reverse">📘</a>
443483
* @param x an int
444484
* @return reversed int
445485
*/
@@ -453,6 +493,7 @@ public static int reverse(int x) {
453493

454494
/**
455495
* Reverse all bits.
496+
* <a href="https://github.com/javaf/extra-boolean/wiki/reverse">📘</a>
456497
* @param x a long
457498
* @return reversed long
458499
*/
@@ -469,6 +510,7 @@ public static long reverse(long x) {
469510

470511
/**
471512
* Sign extend variable bit-width integer.
513+
* <a href="https://github.com/javaf/extra-boolean/wiki/signExtend">📘</a>
472514
* @param x variable bit-width int
473515
* @param w bit width (32)
474516
* @return sign-extended int
@@ -480,6 +522,7 @@ public static int signExtend(int x, int w) {
480522

481523
/**
482524
* Sign extend variable bit-width integer.
525+
* <a href="https://github.com/javaf/extra-boolean/wiki/signExtend">📘</a>
483526
* @param x variable bit-width long
484527
* @param w bit width (64)
485528
* @return sign-extended long

0 commit comments

Comments
 (0)