com.tensegrity.graphics.interaction
Class DefaultInteractionDescriptor

java.lang.Object
  extended bycom.tensegrity.graphics.interaction.DefaultInteractionDescriptor
All Implemented Interfaces:
InteractionDescriptor

public class DefaultInteractionDescriptor
extends java.lang.Object
implements InteractionDescriptor

The DefaultInteractionDescriptor class is the default implementation if the InteractionDescriptor interface.

Version:
$Id: DefaultInteractionDescriptor.java,v 1.9 2005/10/19 13:48:48 BurkhardWick Exp $
Author:
MichaelKegel

Field Summary
 
Fields inherited from interface com.tensegrity.graphics.interaction.InteractionDescriptor
ITEM_INDEX_NONE
 
Constructor Summary
DefaultInteractionDescriptor(java.util.List items, int indexMoveItem)
          Constructor for DefaultInteractionDescriptor.
 
Method Summary
 void addItem(InteractionItem item)
          Adds the item given by item to the InteractionDescriptor.
 InteractionItem getItem(int index)
          Returns the InteractionItem at the index given by index.
 InteractionItem getMoveItem()
          Returns the InteractionItem that moves the BaseInteractable or null if there is no item that moves the whole BaseInteractable.
 int indexOf(InteractionItem item)
          Returns the index for the InteractionItem given by item.
 int indexOfMoveItem()
          Returns the index of the 'move' InteractionItem or InteractionDescriptor.ITEM_INDEX_NONE if no 'move' InteractionItem is available.
 int itemCount()
          Returns the number of InteractionItems currently available for the InteractionDescriptor.
 java.util.Iterator iteratorItems()
          This method returns an iterator which steps over the InteractionItems provided by this InteractionDescriptor object.
 void removeItem(int index)
          Removes the item at the index given by index from the InteractionDescriptor.
 void removeItem(InteractionItem item)
          Removes the InteractionItem given by item from the InteractionDescriptor.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultInteractionDescriptor

public DefaultInteractionDescriptor(java.util.List items,
                                    int indexMoveItem)
Constructor for DefaultInteractionDescriptor.

Method Detail

itemCount

public int itemCount()
Description copied from interface: InteractionDescriptor
Returns the number of InteractionItems currently available for the InteractionDescriptor.

Specified by:
itemCount in interface InteractionDescriptor
Returns:
int the current number of InteractionItems

indexOf

public int indexOf(InteractionItem item)
Description copied from interface: InteractionDescriptor
Returns the index for the InteractionItem given by item.

Specified by:
indexOf in interface InteractionDescriptor
Parameters:
item - the InteractionItem to return the index for
Returns:
int the index of the InteractionItem

indexOfMoveItem

public int indexOfMoveItem()
Description copied from interface: InteractionDescriptor
Returns the index of the 'move' InteractionItem or InteractionDescriptor.ITEM_INDEX_NONE if no 'move' InteractionItem is available.

Specified by:
indexOfMoveItem in interface InteractionDescriptor
Returns:
the index of the 'move' InteractionItem or InteractionDescriptor.ITEM_INDEX_NONE

addItem

public void addItem(InteractionItem item)
Description copied from interface: InteractionDescriptor
Adds the item given by item to the InteractionDescriptor.

Specified by:
addItem in interface InteractionDescriptor
Parameters:
item - the InteractionItem to add

removeItem

public void removeItem(int index)
Description copied from interface: InteractionDescriptor
Removes the item at the index given by index from the InteractionDescriptor.

Specified by:
removeItem in interface InteractionDescriptor
Parameters:
index - the index of the InteractionItem to remove

removeItem

public void removeItem(InteractionItem item)
Description copied from interface: InteractionDescriptor
Removes the InteractionItem given by item from the InteractionDescriptor.

Specified by:
removeItem in interface InteractionDescriptor
Parameters:
item - the InteactionDescriptor to remove

getItem

public InteractionItem getItem(int index)
Description copied from interface: InteractionDescriptor
Returns the InteractionItem at the index given by index.

Specified by:
getItem in interface InteractionDescriptor
Parameters:
index - the index of the InteractionItem to return
Returns:
InteractionIten the InteractionItem at the given index

iteratorItems

public java.util.Iterator iteratorItems()
Description copied from interface: InteractionDescriptor
This method returns an iterator which steps over the InteractionItems provided by this InteractionDescriptor object.

Specified by:
iteratorItems in interface InteractionDescriptor
Returns:
Iterator object for all stored items in this descriptor

getMoveItem

public InteractionItem getMoveItem()
Description copied from interface: InteractionDescriptor
Returns the InteractionItem that moves the BaseInteractable or null if there is no item that moves the whole BaseInteractable.

Specified by:
getMoveItem in interface InteractionDescriptor
Returns:
InteractionItem null or the item that moves the BaseInteractable

toString

public java.lang.String toString()


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.