cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor
Class ItemDescriptor

java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.ItemDescriptor
Direct Known Subclasses:
AdrenalineDescriptor, AmmoDescriptor, ArmorDescriptor, GeneralDescriptor, HealthDescriptor, OtherDescriptor, ShieldDescriptor, WeaponDescriptor

public class ItemDescriptor
extends java.lang.Object

A parent of all item descriptors. Contains attributes common for all descriptors plus some common functions.


Constructor Summary
ItemDescriptor()
           
 
Method Summary
protected  void doReflexion(java.lang.Object configMsg, java.lang.Class<? extends ItemDescriptor> clazz)
          This method does the mapping from a map of attributes contained it ITCMsg and the attributes of the descriptor.
protected  java.lang.String fieldToName(java.lang.String string)
          Converts a fully qualified field name (e.g.
protected  java.lang.String firstCharToUpperCase(java.lang.String input)
           
 int getAmount()
           
 java.lang.String getInventoryType()
           
 ItemType.Category getItemCategory()
           
 ItemType getPickupType()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemDescriptor

public ItemDescriptor()
Method Detail

getAmount

public int getAmount()

getInventoryType

public java.lang.String getInventoryType()

getPickupType

public ItemType getPickupType()

getItemCategory

public ItemType.Category getItemCategory()

fieldToName

protected java.lang.String fieldToName(java.lang.String string)
Converts a fully qualified field name (e.g. private boolean cz.cuni.amis.MyClass.myBoolean) to a field name (e.g. myBoolean).

Parameters:
string - - complete identifier of a field in a class
Returns:
name of a field

firstCharToUpperCase

protected java.lang.String firstCharToUpperCase(java.lang.String input)

doReflexion

protected void doReflexion(java.lang.Object configMsg,
                           java.lang.Class<? extends ItemDescriptor> clazz)
This method does the mapping from a map of attributes contained it ITCMsg and the attributes of the descriptor. NOTE: names of the attributes must be equal to the keys of the HashMap contained in ITCMsg.

Parameters:
configMsg -

toString

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