APIdia Launch Partner
Top Description Inners Methods
java.nio.file

public Interface WatchEvent<T>

Known Direct Implementers
sun.nio.fs.AbstractWatchKey.Event
Type Parameters
<T>
The type of the context object associated with the event

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 and Inner Type Summary

Modifier and TypeClass and Description
public static interface
WatchEvent.Kind<
The type of the context object associated with the event
T
>

An event kind, for the purposes of identification.

public static interface
WatchEvent.Modifier

An event modifier that qualifies how a Watchable is registered with a WatchService.

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

the event context; may be null
context
()

Returns the context for the event.

public int

Returns:

the event count
count
()

Returns the event count.

public WatchEvent.Kind<T>

Returns:

the event kind
kind
()

Returns the event kind.

Method Detail

contextback to summary
public 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:T

the event context; may be null

countback to summary
public int count()

Returns the event count. If the event count is greater than 1 then this is a repeated event.

Returns:int

the event count

kindback to summary
public WatchEvent.Kind<T> kind()

Returns the event kind.

Returns:WatchEvent.Kind<T>

the event kind

java.nio.file back to summary

public Interface WatchEvent.Kind<T>

Known Direct Implementers
java.nio.file.StandardWatchEventKinds.StdWatchEventKind
Type Parameters
<T>
The type of the context object associated with the event

An event kind, for the purposes of identification.
Since
1.7
See Also
StandardWatchEventKinds

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name of the event kind
name
()

Returns the name of the event kind.

public Class<T>

Returns:

the type of the context value
type
()

Returns the type of the context value.

Method Detail

nameback to summary
public String name()

Returns the name of the event kind.

Returns:String

the name of the event kind

typeback to summary
public Class<T> type()

Returns the type of the context value.

Returns:Class<T>

the type of the context value

java.nio.file back to summary

public Interface WatchEvent.Modifier


An event modifier that qualifies how a Watchable is registered with a WatchService.

This release does not define any standard modifiers.

Since
1.7
See Also
Watchable#register

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name of the modifier
name
()

Returns the name of the modifier.

Method Detail

nameback to summary
public String name()

Returns the name of the modifier.

Returns:String

the name of the modifier