Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.net
Class NodeBase

    java.lang.Object
      org.apache.hadoop.net.NodeBase

All Implemented Interfaces:
  Node

    public class NodeBase

extends Object
implements Node

A base class that implements interface Node

Field Summary
`protected int` | `level`
`protected String` | `location`
`protected String` | `name`
`protected Node` | `parent`
`static char` | `PATH_SEPARATOR`
`static String` | `PATH_SEPARATOR_STR`
`static String` | `ROOT`

Constructor Summary
`NodeBase()` Default constructor
`NodeBase(String path)` Construct a node from its path
`NodeBase(String name, String location)` Construct a node from its name and its location
`NodeBase(String name, String location, Node parent, int level)` Construct a node from its name and its location

Method Summary
`int` | `getLevel()` Return this node's level in the tree.
`String` | `getName()` Return this node's name
`String` | `getNetworkLocation()` Return this node's network location
`Node` | `getParent()` Return this node's parent
`static String` | `getPath(Node node)` Return this node's path
`static String` | `normalize(String path)` Normalize a path
`void` | `setLevel(int level)` Set this node's level in the tree
`void` | `setNetworkLocation(String location)` Set this node's network location
`void` | `setParent(Node parent)` Set this node's parent
`String` | `toString()` Return this node's string representation

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### PATH_SEPARATOR

    public static final char PATH_SEPARATOR

See Also:
  Constant Field Values

### PATH_SEPARATOR_STR

    public static final String PATH_SEPARATOR_STR

See Also:
  Constant Field Values

### ROOT

    public static final String ROOT

See Also:
  Constant Field Values

### name

    protected String name

### location

    protected String location

### level

    protected int level

### parent

    protected Node parent

Constructor Detail

### NodeBase

    public NodeBase()

  Default constructor

### NodeBase

    public NodeBase(String path)

  Construct a node from its path

  Parameters:
    `path` - a concatenation of this node's location, the path seperator, and its name

### NodeBase

    public NodeBase(String name,
                    String location)

  Construct a node from its name and its location

  Parameters:
    `name` - this node's name
    `location` - this node's location

### NodeBase

    public NodeBase(String name,
                    String location,
                    Node parent,
                    int level)

  Construct a node from its name and its location

  Parameters:
    `name` - this node's name
    `location` - this node's location
    `parent` - this node's parent node
    `level` - this node's level in the tree

Method Detail

### getName

    public String getName()

  Return this node's name

  Specified by:
    `getName` in interface `Node`

### getNetworkLocation

    public String getNetworkLocation()

  Return this node's network location

  Specified by:
    `getNetworkLocation` in interface `Node`

### setNetworkLocation

    public void setNetworkLocation(String location)

  Set this node's network location

  Specified by:
    `setNetworkLocation` in interface `Node`

### getPath

    public static String getPath(Node node)

  Return this node's path

### toString

    public String toString()

  Return this node's string representation

  Overrides:
    `toString` in class `Object`

### normalize

    public static String normalize(String path)

  Normalize a path

### getParent

    public Node getParent()

  Return this node's parent

  Specified by:
    `getParent` in interface `Node`

### setParent

    public void setParent(Node parent)

  Set this node's parent

  Specified by:
    `setParent` in interface `Node`

### getLevel

    public int getLevel()

  Return this node's level in the tree. E.g. the root of a tree returns 0 and its children return 1

  Specified by:
    `getLevel` in interface `Node`

### setLevel

    public void setLevel(int level)

  Set this node's level in the tree

  Specified by:
    `setLevel` in interface `Node`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation