|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.net.NodeBase
public class NodeBase
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 |
|---|
public static final char PATH_SEPARATOR
public static final String PATH_SEPARATOR_STR
public static final String ROOT
protected String name
protected String location
protected int level
protected Node parent
| Constructor Detail |
|---|
public NodeBase()
public NodeBase(String path)
path - a concatenation of this node's location, the path seperator, and its name
public NodeBase(String name,
String location)
name - this node's namelocation - this node's location
public NodeBase(String name,
String location,
Node parent,
int level)
name - this node's namelocation - this node's locationparent - this node's parent nodelevel - this node's level in the tree| Method Detail |
|---|
public String getName()
getName in interface Nodepublic String getNetworkLocation()
getNetworkLocation in interface Nodepublic void setNetworkLocation(String location)
setNetworkLocation in interface Nodepublic static String getPath(Node node)
public String toString()
toString in class Objectpublic static String normalize(String path)
public Node getParent()
getParent in interface Nodepublic void setParent(Node parent)
setParent in interface Nodepublic int getLevel()
getLevel in interface Nodepublic void setLevel(int level)
setLevel in interface Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||