Advertisement
Guest User

Tree.java

a guest
Mar 26th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import java.util.Iterator;
  2.  
  3.  
  4. public interface Tree extends Iterable{
  5. Position root();
  6. Position parent(Position p) throws IllegalArgumentException;
  7. Iterable<Position> children(Position p) throws IllegalArgumentException;
  8.  
  9. int numChildren(Position p) throws IllegalArgumentException;
  10. boolean isInternal(Position p) throws IllegalArgumentException;
  11. boolean isExternal(Position p) throws IllegalArgumentException;
  12. boolean isRoot(Position p) throws IllegalArgumentException;
  13. int size();
  14. boolean isEmpty();
  15.  
  16. Iterator iterator();
  17. Iterable<Position> positions();
  18. public Position replace(Position p, String e)throws IllegalArgumentException;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement