Skip to content

Commit 3404d4f

Browse files
committed
Minor README, javadoc improvements
1 parent 4b2b531 commit 3404d4f

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ The original use case for JUG was generation of UUID values. This is done by fir
6161
For example:
6262

6363
```java
64-
UUID uuid = Generators.randomBasedGenerator().generate();
65-
UUID uuid = Generators.timeBasedGenerator().generate();
64+
UUID uuid = Generators.timeBasedGenerator().generate(); // Variant 1
65+
UUID uuid = Generators.randomBasedGenerator().generate(); // Variant 4
66+
UUID uuid = Generators.nameBasedgenerator().generate("string to hash"); // Variant 5
67+
// With JUG 4.1+:
68+
UUID uuid = Generators.timeBasedReorderedGenerator().generate(); // Variant 6
69+
UUID uuid = Generators.timeBasedEpochGenerator().generate(); // Variant 7
6670
```
6771

6872
If you want customize generators, you may also just want to hold on to generator instance:
@@ -187,9 +191,9 @@ There are many other publicly available UUID generators. For example:
187191
* JDK has included `java.util.UUID` since 1.4, but omits generation methods (esp. time/location based ones), has sub-standard performance for many operations and implements comparison in useless way
188192
* [ohannburkard.de UUID generator](http://johannburkard.de/software/uuid/)
189193

190-
Note that although some packages claim to be faster than others, it is not clear whether:
194+
Note that although some packages claim to be faster than others, it is not clear:
191195

192-
1. Claims have been properly verified (or, if they have, can be independently verified), AND
193-
2. It is not likely that performance differences truly matter: JUG, for example, can generate a millions of UUID per second per core (sometimes hitting the theoretical limit of 10 million per second) -- and it seems unlikely that generation will be bottleneck for about any use case
196+
1. whether laims have been properly verified (or, if they have, can be independently verified), OR
197+
2. whether performance differences truly matter: JUG, for example, can generate millions of UUID per second per core (sometimes hitting the theoretical limit of 10 million per second) -- and it seems unlikely that generation will be bottleneck for any actual use case
194198

195199
so it is often best to choose based on stability of packages and API.

src/main/java/com/fasterxml/uuid/impl/TimeBasedEpochGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
/**
1111
* Implementation of UUID generator that uses time/location based generation
1212
* method field from the Unix Epoch timestamp source - the number of
13-
* milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded
13+
* milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded.
14+
* This is usually referred to as "Variant 7".
1415
* <p>
1516
* As all JUG provided implementations, this generator is fully thread-safe.
1617
* Additionally it can also be made externally synchronized with other instances

src/main/java/com/fasterxml/uuid/impl/TimeBasedReorderedGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
/**
88
* Implementation of UUID generator that uses time/location based generation
9-
* method field compatible with UUIDv1, reorderd for improved DB locality
10-
* (variant 6).
9+
* method field compatible with UUIDv1, reorderd for improved DB locality.
10+
* This is usually referred to as "Variant 6".
1111
* <p>
1212
* As all JUG provided implementations, this generator is fully thread-safe.
1313
* Additionally it can also be made externally synchronized with other instances

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy