diff options
Diffstat (limited to 'src/main/java/events/implementations')
| -rw-r--r-- | src/main/java/events/implementations/VSLamportTimestampEvent.java | 25 | ||||
| -rw-r--r-- | src/main/java/events/implementations/VSTimestampTriggeredEvent.java | 16 |
2 files changed, 36 insertions, 5 deletions
diff --git a/src/main/java/events/implementations/VSLamportTimestampEvent.java b/src/main/java/events/implementations/VSLamportTimestampEvent.java index 28da7dc..e82ea24 100644 --- a/src/main/java/events/implementations/VSLamportTimestampEvent.java +++ b/src/main/java/events/implementations/VSLamportTimestampEvent.java @@ -6,11 +6,28 @@ import core.VSInternalProcess; * Concrete implementation of a Lamport timestamp-triggered event. * This event fires when a specific Lamport timestamp condition is met. * - * Example usage: - * - Fire when Lamport time equals 10 - * - Fire when Lamport time reaches 50 or greater - * - Fire when Lamport time is less than 5 + * <p>This class allows you to create events that trigger based on Lamport logical time. + * You can specify conditions such as:</p> + * <ul> + * <li>Fire when Lamport time equals 10</li> + * <li>Fire when Lamport time reaches 50 or greater</li> + * <li>Fire when Lamport time is less than 5</li> + * </ul> + * + * <p>Example usage:</p> + * <pre>{@code + * // Create event that fires when Lamport time reaches 100 + * VSLamportTimestampEvent event = new VSLamportTimestampEvent( + * 100, ComparisonOperator.GREATER_EQUAL, "Checkpoint reached"); + * + * // Add custom action + * event.setCustomAction(() -> { + * System.out.println("Lamport time 100 reached!"); + * }); + * }</pre> * + * @see VSTimestampTriggeredEvent + * @see VSTimestampMonitorEvent * @author Paul C. Buetow */ public class VSLamportTimestampEvent extends VSTimestampTriggeredEvent { diff --git a/src/main/java/events/implementations/VSTimestampTriggeredEvent.java b/src/main/java/events/implementations/VSTimestampTriggeredEvent.java index ef99104..c5e5386 100644 --- a/src/main/java/events/implementations/VSTimestampTriggeredEvent.java +++ b/src/main/java/events/implementations/VSTimestampTriggeredEvent.java @@ -14,7 +14,21 @@ import serialize.VSSerialize; /** * Abstract base class for timestamp-triggered events that fire when specific * Lamport or vector clock conditions are met. - * + * + * <p>This class provides the foundation for creating events that trigger based on + * timestamp conditions. Subclasses can define events that fire when:</p> + * <ul> + * <li>Lamport time reaches a specific value</li> + * <li>Vector clock matches certain conditions</li> + * <li>Custom timestamp comparisons are satisfied</li> + * </ul> + * + * <p>Events can use various comparison operators (equal, greater than, less than, etc.) + * and will only trigger once when their condition is first met.</p> + * + * @see VSLamportTimestampEvent + * @see VSVectorTimestampEvent + * @see VSTimestampMonitorEvent * @author Paul C. Buetow */ public abstract class VSTimestampTriggeredEvent extends VSAbstractEvent implements VSCopyableEvent { |
