Package uk.ac.starlink.connect
Class FileNode
- java.lang.Object
-
- uk.ac.starlink.connect.FileNode
-
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
FileBranch
public abstract class FileNode extends java.lang.Object implements Node
Node representing a fileFile
in a local filesystem.- Since:
- 18 Feb 2005
- Author:
- Mark Taylor (Starlink)
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileNode(java.io.File file)
Constructs a node from a File.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileNode
createNode(java.io.File file)
Creates a new FileNode from a File.boolean
equals(java.lang.Object other)
java.io.File
getFile()
java.lang.String
getName()
Returns the name of this node.Branch
getParent()
Returns the parent branch of this node.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:Node
Returns the name of this node. This should not be an entire pathname, that is, it should not include the name of its parent.
-
getParent
public Branch getParent()
Description copied from interface:Node
Returns the parent branch of this node. If this node is at the root of its tree, it will return null.
-
getFile
public java.io.File getFile()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
createNode
public static FileNode createNode(java.io.File file)
Creates a new FileNode from a File.- Parameters:
file
- file- Returns:
- branch or leaf representing file
-
-