public class CountingPathVisitor extends SimplePathVisitor
| Modifier and Type | Field and Description |
|---|---|
(package private) static java.lang.String[] |
EMPTY_STRING_ARRAY |
private Counters.PathCounters |
pathCounters |
| Constructor and Description |
|---|
CountingPathVisitor(Counters.PathCounters pathCounter)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
Counters.PathCounters |
getPathCounters()
Gets the visitation counts.
|
int |
hashCode() |
java.nio.file.FileVisitResult |
postVisitDirectory(java.nio.file.Path dir,
java.io.IOException exc) |
java.lang.String |
toString() |
protected void |
updateFileCounters(java.nio.file.Path file,
java.nio.file.attribute.BasicFileAttributes attributes)
Updates the counters for visiting the given file.
|
java.nio.file.FileVisitResult |
visitFile(java.nio.file.Path file,
java.nio.file.attribute.BasicFileAttributes attributes) |
static CountingPathVisitor |
withBigIntegerCounters()
Creates a new instance configured with a BigInteger
Counters.PathCounters. |
static CountingPathVisitor |
withLongCounters()
Creates a new instance configured with a long
Counters.PathCounters. |
static final java.lang.String[] EMPTY_STRING_ARRAY
private final Counters.PathCounters pathCounters
public CountingPathVisitor(Counters.PathCounters pathCounter)
pathCounter - How to count path visits.public static CountingPathVisitor withBigIntegerCounters()
Counters.PathCounters.Counters.PathCounters.public static CountingPathVisitor withLongCounters()
Counters.PathCounters.Counters.PathCounters.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic Counters.PathCounters getPathCounters()
public int hashCode()
hashCode in class java.lang.Objectpublic java.nio.file.FileVisitResult postVisitDirectory(java.nio.file.Path dir,
java.io.IOException exc)
throws java.io.IOException
postVisitDirectory in interface java.nio.file.FileVisitor<java.nio.file.Path>postVisitDirectory in class java.nio.file.SimpleFileVisitor<java.nio.file.Path>java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectprotected void updateFileCounters(java.nio.file.Path file,
java.nio.file.attribute.BasicFileAttributes attributes)
file - the visited file.attributes - the visited file attributes.public java.nio.file.FileVisitResult visitFile(java.nio.file.Path file,
java.nio.file.attribute.BasicFileAttributes attributes)
throws java.io.IOException
visitFile in interface java.nio.file.FileVisitor<java.nio.file.Path>visitFile in class java.nio.file.SimpleFileVisitor<java.nio.file.Path>java.io.IOException