public abstract class DiffContainer extends DiffElement implements IDiffContainer
This class may be instantiated, or further subclassed.
FOLDER_TYPE, TEXT_TYPE, UNKNOWN_TYPE
Constructor and Description |
---|
DiffContainer(IDiffContainer parent,
int kind)
Creates a new container with the specified kind under the given parent.
|
Modifier and Type | Method and Description |
---|---|
void |
add(IDiffElement diff)
Adds the given child to this container.
|
IDiffElement |
findChild(String name)
Tries to find the child with the given name.
|
IDiffElement[] |
getChildren()
Returns the children of this container.
|
boolean |
hasChildren()
Returns whether this container has at least one child.
|
void |
remove(IDiffElement child)
Removes the given child (non-recursively) from this container.
|
void |
removeToRoot(IDiffElement child)
Removes the given child from this container.
|
getImage, getKind, getParent, getType, setKind, setParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKind, getParent, setParent
getImage, getName, getType
public DiffContainer(IDiffContainer parent, int kind)
parent
- under which the new container is added as a child or null
.kind
- of difference (defined in Differencer
).public IDiffElement findChild(String name)
null
if no such child exists.name
- of the child to findpublic void add(IDiffElement diff)
IDiffContainer
add
in interface IDiffContainer
diff
- the child to be added to this containerpublic void removeToRoot(IDiffElement child)
IDiffContainer
removeToRoot
in interface IDiffContainer
child
- the child to be removed from this containerpublic void remove(IDiffElement child)
child
- to removepublic boolean hasChildren()
IDiffContainer
getChildren
method.hasChildren
in interface IDiffContainer
true
if this container has at least one childpublic IDiffElement[] getChildren()
IDiffContainer
null
).getChildren
in interface IDiffContainer
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.