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
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface and Description
      static interface  WatchEvent.Kind<T>
      An event kind, for the purposes of identification.
      static interface  WatchEvent.Modifier
      An event modifier that qualifies how a Watchable is registered with a WatchService.

        

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      T context()
      Returns the context for the event.
      int count()
      Returns the event count.
      WatchEvent.Kind<T> kind()
      Returns the event kind.

        

    • 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

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 11/06/2005, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-java/nio/file/WatchEvent.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut