com.planet_ink.coffee_mud.Common
Class DefaultAbilityComponent

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultAbilityComponent
All Implemented Interfaces:
AbilityComponent, CMCommon, CMObject, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultAbilityComponent
extends java.lang.Object
implements AbilityComponent


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Common.interfaces.AbilityComponent
AbilityComponent.CompConnector, AbilityComponent.CompLocation, AbilityComponent.CompType
 
Constructor Summary
DefaultAbilityComponent()
           
 
Method Summary
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 int getAmount()
          Returns the number of items matching this component which must be present.
 MaskingLibrary.CompiledZMask getCompiledMask()
          Returns the compiled zapper mask to determine whether a given agent qualifies this item as a component.
 AbilityComponent.CompConnector getConnector()
          Returns an enum describing how this component "connects" with the following component logically.
 AbilityComponent.CompLocation getLocation()
          Returns an enum value describing where an item must be to be considered a valid component.
 long getLongType()
          For resource and material type item component filters, this will return the type comparison object as a long value.
 java.lang.String getMaskStr()
          Returns the raw zapper mask to determine whether a given agent qualifies this item as a component.
 java.lang.String getStringType()
          For resource and material type item component filters, this will return the type comparison object as a String value.
 java.lang.String getSubType()
          Returns the item filter type for determining whether an item is a component.
 AbilityComponent.CompType getType()
          Returns the item filter type for determining whether an item is a component.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 boolean isConsumed()
          Gets whether or not this component is consumed upon use
 java.lang.String name()
          The displayable name of this object.
 CMObject newInstance()
          Returns a new instance of this class.
 void setAmount(int amount)
          Sets the number of items matching this component which must be present.
 void setConnector(AbilityComponent.CompConnector connector)
          Sets an enum describing how this component "connects" with the following component logically.
 void setConsumed(boolean isConsumed)
          Sets whether or not this component is consumed upon use
 void setLocation(AbilityComponent.CompLocation location)
          Sets an enum value describing where an item must be to be considered a valid component.
 void setMask(java.lang.String maskStr)
          Sets the raw zapper mask to determine whether a given agent qualifies this item as a component.
 void setType(AbilityComponent.CompType type, java.lang.Object typeObj, java.lang.String subType)
          Sets the item filter type for determining whether an item is a component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAbilityComponent

public DefaultAbilityComponent()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

name

public java.lang.String name()
Description copied from interface: CMObject
The displayable name of this object. May be modified by phyStats() object. Is derived from the Name().

Specified by:
name in interface CMObject
Returns:
the modified final name of this object on the map.
See Also:
Environmental.Name()

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

getConnector

public AbilityComponent.CompConnector getConnector()
Description copied from interface: AbilityComponent
Returns an enum describing how this component "connects" with the following component logically. As in, is it required WITH the following component, or instead of?

Specified by:
getConnector in interface AbilityComponent
Returns:
a connector enum
See Also:
AbilityComponent.CompConnector, AbilityComponent.setConnector(CompConnector)

setConnector

public void setConnector(AbilityComponent.CompConnector connector)
Description copied from interface: AbilityComponent
Sets an enum describing how this component "connects" with the following component logically. As in, is it required WITH the following component, or instead of?

Specified by:
setConnector in interface AbilityComponent
Parameters:
connector - a connector enum
See Also:
AbilityComponent.CompConnector, AbilityComponent.getConnector()

getLocation

public AbilityComponent.CompLocation getLocation()
Description copied from interface: AbilityComponent
Returns an enum value describing where an item must be to be considered a valid component.

Specified by:
getLocation in interface AbilityComponent
Returns:
where an item must be to be a component
See Also:
AbilityComponent.CompLocation, AbilityComponent.setLocation(CompLocation)

setLocation

public void setLocation(AbilityComponent.CompLocation location)
Description copied from interface: AbilityComponent
Sets an enum value describing where an item must be to be considered a valid component.

Specified by:
setLocation in interface AbilityComponent
Parameters:
location - where an item must be to be a component
See Also:
AbilityComponent.CompLocation, AbilityComponent.getLocation()

isConsumed

public boolean isConsumed()
Description copied from interface: AbilityComponent
Gets whether or not this component is consumed upon use

Specified by:
isConsumed in interface AbilityComponent
Returns:
true if consumed, false otherwise
See Also:
AbilityComponent.setConsumed(boolean)

setConsumed

public void setConsumed(boolean isConsumed)
Description copied from interface: AbilityComponent
Sets whether or not this component is consumed upon use

Specified by:
setConsumed in interface AbilityComponent
Parameters:
isConsumed - true if consumed, false otherwise
See Also:
AbilityComponent.isConsumed()

getAmount

public int getAmount()
Description copied from interface: AbilityComponent
Returns the number of items matching this component which must be present.

Specified by:
getAmount in interface AbilityComponent
Returns:
the number of items matching this component which must be present.
See Also:
AbilityComponent.setAmount(int)

setAmount

public void setAmount(int amount)
Description copied from interface: AbilityComponent
Sets the number of items matching this component which must be present.

Specified by:
setAmount in interface AbilityComponent
Parameters:
amount - the number of items matching this component which must be present
See Also:
AbilityComponent.getAmount()

getCompiledMask

public MaskingLibrary.CompiledZMask getCompiledMask()
Description copied from interface: AbilityComponent
Returns the compiled zapper mask to determine whether a given agent qualifies this item as a component.

Specified by:
getCompiledMask in interface AbilityComponent
Returns:
the compiled zapper mask
See Also:
AbilityComponent.getMaskStr(), AbilityComponent.setMask(String), MaskingLibrary

getMaskStr

public java.lang.String getMaskStr()
Description copied from interface: AbilityComponent
Returns the raw zapper mask to determine whether a given agent qualifies this item as a component.

Specified by:
getMaskStr in interface AbilityComponent
Returns:
the raw zapper mask
See Also:
AbilityComponent.getCompiledMask(), AbilityComponent.setMask(String), MaskingLibrary

setMask

public void setMask(java.lang.String maskStr)
Description copied from interface: AbilityComponent
Sets the raw zapper mask to determine whether a given agent qualifies this item as a component.

Specified by:
setMask in interface AbilityComponent
Parameters:
maskStr - the raw zapper mask
See Also:
AbilityComponent.getCompiledMask(), AbilityComponent.getMaskStr(), MaskingLibrary

getType

public AbilityComponent.CompType getType()
Description copied from interface: AbilityComponent
Returns the item filter type for determining whether an item is a component. This type can designate a resource, material, or an item name string.

Specified by:
getType in interface AbilityComponent
Returns:
a CompType enum
See Also:
AbilityComponent.CompType, AbilityComponent.setType(CompType, Object, String)

setType

public void setType(AbilityComponent.CompType type,
                    java.lang.Object typeObj,
                    java.lang.String subType)
Description copied from interface: AbilityComponent
Sets the item filter type for determining whether an item is a component. This type can designate a resource, material, or an item name string. Also sent is either the resource mask, material mask, a string for a name filter, or a string with a long number in it.

Specified by:
setType in interface AbilityComponent
Parameters:
type - the CompType enum
typeObj - either a Integer object or a String
subType - the typeObj subType
See Also:
AbilityComponent.CompType, AbilityComponent.getType(), AbilityComponent.getSubType(), AbilityComponent.getLongType(), AbilityComponent.getStringType()

getLongType

public long getLongType()
Description copied from interface: AbilityComponent
For resource and material type item component filters, this will return the type comparison object as a long value. This is typically a resource or material mask value.

Specified by:
getLongType in interface AbilityComponent
Returns:
a resource or material mask value
See Also:
AbilityComponent.setType(CompType, Object, String)

getStringType

public java.lang.String getStringType()
Description copied from interface: AbilityComponent
For resource and material type item component filters, this will return the type comparison object as a String value. This is typically a item name filter.

Specified by:
getStringType in interface AbilityComponent
Returns:
a item name filter
See Also:
AbilityComponent.setType(CompType, Object, String)

getSubType

public java.lang.String getSubType()
Description copied from interface: AbilityComponent
Returns the item filter type for determining whether an item is a component. This type can designate a resource, material, or an item name string.

Specified by:
getSubType in interface AbilityComponent
Returns:
a String type
See Also:
AbilityComponent.CompType, AbilityComponent.setType(CompType, Object, String)