Package jadex.examples.shop
Class ShopService
- java.lang.Object
-
- jadex.bridge.service.BasicService
-
- jadex.examples.shop.ShopService
-
- All Implemented Interfaces:
IShopService
,IInternalService
,IService
public class ShopService extends BasicService implements IShopService
The shop for buying goods at the shop.
-
-
Field Summary
Fields Modifier and Type Field Description protected IExternalAccess
comp
The component.protected java.lang.String
name
The shop name.-
Fields inherited from class jadex.bridge.service.BasicService
idcnt, impltype, internalaccess, providerid, shutdowned, sid, started, type
-
Fields inherited from interface jadex.bridge.service.IService
EMPTY_SERVICES
-
-
Constructor Summary
Constructors Constructor Description ShopService(IExternalAccess comp, java.lang.String name)
Create a new shop service.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<ItemInfo>
buyItem(java.lang.String item, double price)
Buy an item.IFuture<ItemInfo[]>
getCatalog()
Get the item catalog.java.lang.String
getName()
Get the shop name.java.lang.String
toString()
Get the string representation.-
Methods inherited from class jadex.bridge.service.BasicService
createServiceIdentifier, createServiceIdentifier, equals, generateServiceName, getInterfaceType, getInternalAccess, getInvokeMethod, getMethodInfos, getMethodTimeout, getPropertyMap, getProviderId, getServiceId, hashCode, initNFProperties, invokeMethod, isValid, setComponentAccess, setPropertyMap, setServiceIdentifier, shutdownService, startService
-
-
-
-
Field Detail
-
comp
protected IExternalAccess comp
The component.
-
name
protected java.lang.String name
The shop name.
-
-
Constructor Detail
-
ShopService
public ShopService(IExternalAccess comp, java.lang.String name)
Create a new shop service.- Parameters:
comp
- The active component.
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the shop name.- Specified by:
getName
in interfaceIShopService
- Returns:
- The name.
-
buyItem
public IFuture<ItemInfo> buyItem(java.lang.String item, double price)
Buy an item.- Specified by:
buyItem
in interfaceIShopService
- Parameters:
item
- The item.
-
getCatalog
public IFuture<ItemInfo[]> getCatalog()
Get the item catalog.- Specified by:
getCatalog
in interfaceIShopService
- Returns:
- The catalog.
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toString
in classBasicService
- Returns:
- The string representation.
-
-