TreeMap Java Library

treemap.demo
Class TMFileModelNode

java.lang.Object
  extended by treemap.demo.TMFileModelNode
All Implemented Interfaces:
TMModelNode

public class TMFileModelNode
extends java.lang.Object
implements TMModelNode

The TMFileModelNode implements an example of TMModelNode encapsulating Files.

Version:
2.5
Author:
Christophe Bouthier [bouthier@loria.fr]

Constructor Summary
TMFileModelNode(java.io.File root)
          Constructor.
 
Method Summary
 java.util.Enumeration children(java.lang.Object node)
          Returns the children of this node in an Enumeration.
 java.lang.Object getRoot()
          Returns the root of the tree.
 boolean isLeaf(java.lang.Object node)
          Returns true if this node is not a directory.
 void setUpdater(TMModelUpdater updater)
          Sets the updater for this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TMFileModelNode

public TMFileModelNode(java.io.File root)
Constructor.

Parameters:
root - the File root of this tree
Method Detail

getRoot

public java.lang.Object getRoot()
Returns the root of the tree. Should not return null.

Specified by:
getRoot in interface TMModelNode
Returns:
the root of the tree

children

public java.util.Enumeration children(java.lang.Object node)
Returns the children of this node in an Enumeration. If this node is a file, return a empty Enumeration. Else, return an Enumeration full with TMFileNode.

Specified by:
children in interface TMModelNode
Returns:
an Enumeration containing childs of this node

isLeaf

public boolean isLeaf(java.lang.Object node)
Returns true if this node is not a directory.

Specified by:
isLeaf in interface TMModelNode
Returns:
false if this node is a directory; true otherwise

setUpdater

public void setUpdater(TMModelUpdater updater)
Sets the updater for this node.

Specified by:
setUpdater in interface TMModelNode
Parameters:
updater - the updater for this node

TreeMap Java Library

TreeMap Java Library - www.bouthier.net - treemap.sf.net - 2001