Methods Summary |
---|
protected void | addChild(IItem item)
if (item == null) throw new IllegalArgumentException ("null input: item");
m_children.add (item);
|
public int | getAggregate(int type)
final int [] aggregates = m_aggregates;
int value = aggregates [type];
if (value < 0)
{
// don't fault aggregate types all at once since there are
// plenty of exceptions to the additive roll up rule:
value = 0;
for (Iterator children = m_children.iterator (); children.hasNext (); )
{
value += ((IItem) children.next ()).getAggregate (type);
}
aggregates [type] = value;
return value;
}
return value;
|
public final IItemAttribute | getAttribute(int attributeID, int unitsID)
//if ($assert.ENABLED) $assert.ASSERT ((attributeID & getMetadata ().getAttributeIDs ()) != 0, "invalid attribute ID [" + attributeID + "] for type [" + getMetadata ().getTypeID () + "]");
if ((getMetadata ().getAttributeIDs () & (1 << attributeID)) == 0)
return null;
else
return IItemAttribute.Factory.getAttribute (attributeID, unitsID);
|
public final int | getChildCount()
return m_children.size ();
|
public final java.util.Iterator | getChildren()
return m_children.iterator ();
|
public final java.util.Iterator | getChildren(ItemComparator order)
// TODO: soft caching keyed off 'order'
if (order == null)
return getChildren ();
else
{
final IItem [] items = new IItem [m_children.size ()];
m_children.toArray (items);
Arrays.sort (items, order);
return Arrays.asList (items).iterator ();
}
|
public final IItem | getParent()
return m_parent;
|