|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 namepublic NodeBase(String name, String location)
name
- this node's namelocation
- this node's locationpublic 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 treeMethod Detail |
---|
public String getName()
getName
in interface Node
public String getNetworkLocation()
getNetworkLocation
in interface Node
public void setNetworkLocation(String location)
setNetworkLocation
in interface Node
public static String getPath(Node node)
public String toString()
toString
in class Object
public static String normalize(String path)
public Node getParent()
getParent
in interface Node
public void setParent(Node parent)
setParent
in interface Node
public int getLevel()
getLevel
in interface Node
public void setLevel(int level)
setLevel
in interface Node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |