NodeInnerNodeImpl@LimitedPrivate({"HDFS","MapReduce"})
@Unstable
public class NodeBase
extends java.lang.Object
implements Node
| Modifier and Type | Field | Description |
|---|---|---|
protected int |
level |
|
protected java.lang.String |
location |
|
protected java.lang.String |
name |
|
protected Node |
parent |
|
static char |
PATH_SEPARATOR |
Path separator 47
|
static java.lang.String |
PATH_SEPARATOR_STR |
Path separator as a string "/"
|
static java.lang.String |
ROOT |
string representation of root ""
|
| Constructor | Description |
|---|---|
NodeBase() |
Default constructor
|
NodeBase(java.lang.String path) |
Construct a node from its path
|
NodeBase(java.lang.String name,
java.lang.String location) |
Construct a node from its name and its location
|
NodeBase(java.lang.String name,
java.lang.String location,
Node parent,
int level) |
Construct a node from its name and its location
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(java.lang.Object to) |
|
int |
getLevel() |
|
java.lang.String |
getName() |
|
java.lang.String |
getNetworkLocation() |
|
Node |
getParent() |
|
static java.lang.String |
getPath(Node node) |
Get the path of a node
|
static java.lang.String[] |
getPathComponents(Node node) |
Get the path components of a node.
|
int |
hashCode() |
|
static int |
locationToDepth(java.lang.String location) |
|
static java.lang.String |
normalize(java.lang.String path) |
Normalize a path by stripping off any trailing
PATH_SEPARATOR |
void |
setLevel(int level) |
Set this node's level in the tree
|
void |
setNetworkLocation(java.lang.String location) |
Set this node's network location
|
void |
setParent(Node parent) |
Set this node's parent
|
java.lang.String |
toString() |
public static final char PATH_SEPARATOR
public static final java.lang.String PATH_SEPARATOR_STR
public static final java.lang.String ROOT
protected java.lang.String name
protected java.lang.String location
protected int level
protected Node parent
public NodeBase()
public NodeBase(java.lang.String path)
path - a concatenation of this node's location, the path separator, and its namepublic NodeBase(java.lang.String name,
java.lang.String location)
name - this node's name (can be null, must not contain PATH_SEPARATOR)location - this node's locationpublic NodeBase(java.lang.String name,
java.lang.String location,
Node parent,
int level)
name - this node's name (can be null, must not contain PATH_SEPARATOR)location - this node's locationparent - this node's parent nodelevel - this node's level in the treepublic java.lang.String getName()
public java.lang.String getNetworkLocation()
getNetworkLocation in interface Nodepublic void setNetworkLocation(java.lang.String location)
setNetworkLocation in interface Nodelocation - the locationpublic static java.lang.String getPath(Node node)
node - a non-null nodepublic static java.lang.String[] getPathComponents(Node node)
node - a non-null nodepublic boolean equals(java.lang.Object to)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String normalize(java.lang.String path)
PATH_SEPARATORpath - path to normalize.ROOT is returnedjava.lang.IllegalArgumentException - if the first character of a non empty path
is not PATH_SEPARATORpublic Node getParent()
public void setParent(Node parent)
public int getLevel()
public void setLevel(int level)
public static int locationToDepth(java.lang.String location)
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.