Last active
August 29, 2015 14:16
-
-
Save mickeypash/94891874634cab7e22b0 to your computer and use it in GitHub Desktop.
suggested way of calculating the number of files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lab exam for calculating the number of files and folders in a file system | |
http://sourcemaking.com/design_patterns/Composite/java/1 | |
interface FileComponent | |
+ calculateTotal(); | |
FileComposite | |
+ calculateTotal() | |
for item in composite | |
total += leaf.calculateTotal(); | |
FileLeaf | |
+ calculateTotal() | |
return 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment