Bees v0.5.0 API

bees.core.bdomain
Class CapabilityTree

java.lang.Object
  |
  +--bees.core.bdomain.CapabilityTree

public final class CapabilityTree
extends java.lang.Object

A CapabilityTree is a helper class used to produce an array of CapabilityEnvelopes from a tree of envelopes and other CapabilityTrees.


Constructor Summary
CapabilityTree(CapabilityEnvelope[] ce)
          Construct a CapabilityTree with the given value.
CapabilityTree(CapabilityEnvelope[] ce, CapabilityTree[] children)
          Construct a CapabilityTree with the given values.
CapabilityTree(CapabilityTree[] children)
          Construct a CapabilityTree with the given value.
CapabilityTree(ObjectMap om)
          Construct a CapabilityTree with the given values.
CapabilityTree(java.lang.String prefix, ObjectMap om)
          Construct a CapabilityTree with the given values.
CapabilityTree(java.lang.String prefix, ObjectMap om, CapabilityTree[] children)
          Construct a CapabilityTree with the given values.
 
Method Summary
 CapabilityTree addChild(CapabilityTree ct)
          Add a child tree to this node.
 CapabilityEnvelope[] flatten()
           
static CapabilityEnvelope[] flattenMap(java.lang.String prefix, ObjectMap om)
          Flatten the given object map into an array of CapabilityEnvelopes.
static java.util.Vector flattenMap(java.util.Vector vec, java.lang.String prefix, ObjectMap om)
          Flatten the given object map into a Vector of CapabilityEnvelopes.
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CapabilityTree

public CapabilityTree(CapabilityEnvelope[] ce,
                      CapabilityTree[] children)
Construct a CapabilityTree with the given values.
Parameters:
ce - The array of CapabilityEnvelopes that make up this node in the tree.
children - The CapabilityTree's that are children of this node.

CapabilityTree

public CapabilityTree(CapabilityTree[] children)
Construct a CapabilityTree with the given value.
Parameters:
children - The CapabilityTree's that are children of this node.

CapabilityTree

public CapabilityTree(CapabilityEnvelope[] ce)
Construct a CapabilityTree with the given value.
Parameters:
ce - The array of CapabilityEnvelopes that make up this node in the tree.

CapabilityTree

public CapabilityTree(java.lang.String prefix,
                      ObjectMap om,
                      CapabilityTree[] children)
Construct a CapabilityTree with the given values.
Parameters:
prefix - The prefix to add to any envelope names or null if the envelopes should be anonymous.
om - The ObjectMap to break down into separate envelopes.
children - The CapabilityTree's that are children of this node.

CapabilityTree

public CapabilityTree(java.lang.String prefix,
                      ObjectMap om)
Construct a CapabilityTree with the given values.
Parameters:
prefix - The prefix to add to any envelope names or null if the envelopes should be anonymous.
om - The ObjectMap to break down into separate envelopes.

CapabilityTree

public CapabilityTree(ObjectMap om)
Construct a CapabilityTree with the given values.
Parameters:
om - The ObjectMap to break down into separate anonymous envelopes.
Method Detail

flattenMap

public static java.util.Vector flattenMap(java.util.Vector vec,
                                          java.lang.String prefix,
                                          ObjectMap om)
Flatten the given object map into a Vector of CapabilityEnvelopes.
Parameters:
vec - The vector to add the envelopes to or null if a new one should be created.
prefix - The prefix to add to any envelope names or null if the envelopes should be anonymous.
om - The ObjectMap to break down into separate envelopes.
Returns:
"vec" or a new Vector containing CapabilityEnvelopes that refer to the capabilities in "om".

flattenMap

public static CapabilityEnvelope[] flattenMap(java.lang.String prefix,
                                              ObjectMap om)
Flatten the given object map into an array of CapabilityEnvelopes.
Parameters:
prefix - The prefix to add to any envelope names or null if the envelopes should be anonymous.
om - The ObjectMap to break down into separate envelopes.
Returns:
A new array containing CapabilityEnvelopes that refer to the capabilities in "om".

addChild

public CapabilityTree addChild(CapabilityTree ct)
Add a child tree to this node.
Parameters:
ct - The child CapabilityTree to add to this node.
Returns:
this

size

public int size()
Returns:
The number of CapabilityEnvelopes in this tree.

flatten

public CapabilityEnvelope[] flatten()
Returns:
The array of CapabilityEnvelopes that make up this tree.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

Bees v0.5.0 API

This documentation is Copyright (C) 2002 The University of Utah. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for Bees v0.5.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/