public class IlvNodeGroup extends Object implements IlvPersistentObject
IlvNodeGroup
allows to create a group of nodes
that is subject to a constraint.
A node group itself is not a constraint. But some constraints allow node groups as input rather than single nodes. For instance, it is possible to force a group of nodes to be placed in a higher level than another group of nodes. Or it is possible to force all nodes of the group to be placed no more than a certain number of levels apart.
IlvHierarchicalLayout.addConstraint(IlvHierarchicalConstraint)
,
Serialized FormConstructor and Description |
---|
IlvNodeGroup()
Creates a new
IlvNodeGroup . |
IlvNodeGroup(IlvInputStream stream)
Creates a new
IlvNodeGroup from an
IlvInputStream . |
IlvNodeGroup(IlvNodeGroup source)
Creates a new
IlvNodeGroup by copying an existing one. |
IlvNodeGroup(Vector nodes)
Creates a new
IlvNodeGroup . |
Modifier and Type | Method and Description |
---|---|
void |
add(Object node)
Adds a node to the node group.
|
boolean |
contains(Object node)
Returns
true if the node belongs to this group. |
Enumeration |
elements()
Returns the nodes in the node group.
|
void |
remove(Object node)
Removes a node from the node group.
|
int |
size()
Returns the number of nodes in the node group.
|
void |
write(IlvOutputStream stream)
Writes the constraint to the output stream.
|
public IlvNodeGroup()
IlvNodeGroup
.public IlvNodeGroup(Vector nodes)
IlvNodeGroup
.nodes
- A vector containing the nodes that belong to this group.
The vector is copied into the new group. When a group becomes
subject of a constraint, the constraint applies to all nodes of the
group.public IlvNodeGroup(IlvNodeGroup source)
IlvNodeGroup
by copying an existing one.
source
- The origin of the copy.public IlvNodeGroup(IlvInputStream stream) throws IOException, IlvReadFileException
IlvNodeGroup
from an
IlvInputStream
.
stream
- The input stream from which the property must be read.IlvReadFileException
- if an error occurs while reading.IOException
public void write(IlvOutputStream stream) throws IOException
write
in interface IlvPersistentObject
stream
- The output stream.IOException
- standard IO error.public void add(Object node)
node
- The node instance.remove(Object)
public void remove(Object node)
node
- The node instance.add(Object)
public int size()
public Enumeration elements()
public boolean contains(Object node)
true
if the node belongs to this group.node
- The node instance.true
if the node belongs to this group.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.