ti.chimera.fs
Class FileSystemTreeModel.FileSystemNode

java.lang.Object
  extended byti.chimera.fs.FileSystemTreeModel.FileSystemNode
Enclosing class:
FileSystemTreeModel

public static class FileSystemTreeModel.FileSystemNode
extends java.lang.Object

Because the AbstractFileSystem.children() can be expensive, we cache the results in the FileSystemNode.


Method Summary
 boolean equals(java.lang.Object obj)
          Two nodes are determined to be equal if they represent the same file.
 FileSystemTreeModel.FileSystemNode getChild(int idx)
          Get the child at the specified index (0..getChildCount()-1)
 int getChildCount()
          Get the number of children
 oscript.fs.AbstractFile getFile()
          Get the file represented by this node.
 FileSystemTreeModel.FileSystemNode getParent()
          Access this node's parent.
 int hashCode()
           
 long lastModified()
          Get the modification time of the file.
 long length()
          Get the length of the file.
 boolean pending()
          Return true if we are still waiting on the worker thread to know the children of this node, or any parent of this node.
 java.lang.String toString()
          Cast to string, which is useful if a default-cell-renderer is used.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getParent

public FileSystemTreeModel.FileSystemNode getParent()
Access this node's parent.


getFile

public oscript.fs.AbstractFile getFile()
Get the file represented by this node.


pending

public boolean pending()
Return true if we are still waiting on the worker thread to know the children of this node, or any parent of this node.


length

public long length()
Get the length of the file. If this info is needed from the AWT thread, this should be called instead of getFile().length(), to avoid potentially expensive filesystem access from the AWT thread. If this method returns -1, that means that the length is not known yet. In this case, a tree event will be fired once it is known.


lastModified

public long lastModified()
Get the modification time of the file. If this info is needed from the AWT thread, this should be called instead of getFile().lastModified(), to avoid potentially expensive filesystem access from the AWT thread. If this method returns -1, that means that the modification time is not known yet. In this case, a tree event will be fired once it is known.


getChildCount

public int getChildCount()
Get the number of children


getChild

public FileSystemTreeModel.FileSystemNode getChild(int idx)
Get the child at the specified index (0..getChildCount()-1)

Parameters:
idx - the child index
Returns:
the child node

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object obj)
Two nodes are determined to be equal if they represent the same file.


toString

public java.lang.String toString()
Cast to string, which is useful if a default-cell-renderer is used.