Class 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 
      Modifier Constructor Description
      protected FileNode​(java.io.File file)
      Constructs a node from a File.
    • 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