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

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

### Constructor Summary

Constructors
`protected` `FileNode​(java.io.File file)` Constructs a node from a File.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`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()`

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

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

### Constructor Detail

#### FileNode

    protected FileNode​(java.io.File file)

Constructs a node from a File.

Parameters:
  `file` - file

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

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 java.io.File getFile()

#### equals

    public boolean equals​(java.lang.Object other)

Overrides:
  `equals` in class `java.lang.Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.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`