java.nio.file

Interface WatchEvent<T>

  • Type Parameters:
    T - The type of the context object associated with the event

    public interface WatchEvent<T>
    An event or a repeated event for an object that is registered with a WatchService.

    An event is classified by its kind and has a count to indicate the number of times that the event has been observed. This allows for efficient representation of repeated events. The context method returns any context associated with the event. In the case of a repeated event then the context is the same for all events.

    Watch events are immutable and safe for use by multiple concurrent threads.

    Since:
    1.7
    • Method Detail

      • kind

        WatchEvent.Kind<T> kind()
        Returns the event kind.
        Returns:
        the event kind
      • count

        int count()
        Returns the event count. If the event count is greater than 1 then this is a repeated event.
        Returns:
        the event count
      • context

        T context()
        Returns the context for the event.

        In the case of ENTRY_CREATE, ENTRY_DELETE, and ENTRY_MODIFY events the context is a Path that is the relative path between the directory registered with the watch service, and the entry that is created, deleted, or modified.

        Returns:
        the event context; may be null

Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-java/nio/file/watchevent.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : https://docs.oracle.com

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut