@Test public void removeChildTest() { InodeFolder inodeFolder = new InodeFolder("testFolder1", 1, 0, System.currentTimeMillis()); InodeFile inodeFile1 = new InodeFile("testFile1", 2, 1, 1000, System.currentTimeMillis()); inodeFolder.addChild(inodeFile1); Assert.assertEquals(1, inodeFolder.getNumberOfChildren()); inodeFolder.removeChild(inodeFile1); Assert.assertEquals(0, inodeFolder.getNumberOfChildren()); }
public synchronized boolean removeChild(Inode child) { return mChildren.remove(child); }
InodeFolder extends Inode { public synchronized boolean removeChild(Inode child) { return mChildren.remove(child); } }
InodeFolder extends Inode { public synchronized boolean removeChild(Inode child) { return mChildren.remove(child); } InodeFolder(String name, int id, int parentId, long creationTimeMs); }
InodeFolder extends Inode { public synchronized boolean removeChild(Inode child) { return mChildren.remove(child); } InodeFolder(String name, int id, int parentId, long creationTimeMs); synchronized void addChild(Inode child); synchronized void addChildren(Inode[] children); @Override ClientFileInfo generateClientFileInfo(String path); synchronized Inode getChild(int fid); synchronized Inode getChild(String name); synchronized Set<Inode> getChildren(); synchronized List<Integer> getChildrenIds(); synchronized int getNumberOfChildren(); synchronized boolean removeChild(Inode child); synchronized boolean removeChild(String name); @Override String toString(); @Override void writeImage(ObjectWriter objWriter, DataOutputStream dos); }
InodeFolder extends Inode { public synchronized boolean removeChild(Inode child) { return mChildren.remove(child); } InodeFolder(String name, int id, int parentId, long creationTimeMs); synchronized void addChild(Inode child); synchronized void addChildren(Inode[] children); @Override ClientFileInfo generateClientFileInfo(String path); synchronized Inode getChild(int fid); synchronized Inode getChild(String name); synchronized Set<Inode> getChildren(); synchronized List<Integer> getChildrenIds(); synchronized int getNumberOfChildren(); synchronized boolean removeChild(Inode child); synchronized boolean removeChild(String name); @Override String toString(); @Override void writeImage(ObjectWriter objWriter, DataOutputStream dos);  }