Lets consider the following code:
Files.walkFileTree(Path start, FileVisitor<? super Path> visitor)
Here utility is walkFileTree method of Files class. In order to work with this utility we must provide some object that implements FileVisitor interface and this object will be used by this utility. I mean that all the logic of walking file tree is in utility and and the object we provide is used just to handle special events - previsit, postvisit etc. Is this a design pattern? If yes, what is its name?
Aucun commentaire:
Enregistrer un commentaire