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 Object implements Node
Node representing a file `File` in a local filesystem.

Since:
  18 Feb 2005
Author:
  Mark Taylor (Starlink)

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`FileNode(File file)`
Constructs a node from a File.

## Method Summary

Modifier and Type
Method
Description
`static FileNode`
`createNode(File file)`
Creates a new FileNode from a File.
`boolean`
`equals(Object other)`
`File`
`getFile()`
`String`
`getName()`
Returns the name of this node.
`Branch`
`getParent()`
Returns the parent branch of this node.
`int`
`hashCode()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### FileNode

protected FileNode(File file)
Constructs a node from a File.

Parameters:
  `file` - file

## Method Details

### getName

public 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.

Specified by:
  `getName` in interface `Node`
Returns:
  name

### 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`.

Specified by:
  `getParent` in interface `Node`
Returns:
  parent

### getFile

public File getFile()

### equals

public boolean equals(Object other)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### createNode

public static FileNode createNode(File file)
Creates a new FileNode from a File.

Parameters:
  `file` - file
Returns:
  branch or leaf representing `file`