Added some documentation

This commit is contained in:
7u83 2017-04-09 09:22:32 +02:00
parent f6c1c2534c
commit f8d6942ab7
3 changed files with 31 additions and 2 deletions

View File

@ -65,7 +65,8 @@ public abstract class AutoTraderBase implements AutoTraderInterface, TimerTaskRu
return name;
}
// @Override
@Override
public long getID() {
return id;
}
@ -75,6 +76,7 @@ public abstract class AutoTraderBase implements AutoTraderInterface, TimerTaskRu
return se.getAccount(account_id);
}
@Override
public void init(Exchange se, long id, String name, double money, double shares, JSONObject cfg) {
this.account_id = se.createAccount(money, shares);
se.getAccount(account_id).owner = this;

View File

@ -29,7 +29,7 @@ import javax.swing.JDialog;
import org.json.JSONObject;
/**
*
* Interface for auto traders
* @author 7u83 <7u83@mail.ru>
*/
public interface AutoTraderInterface {
@ -38,16 +38,42 @@ public interface AutoTraderInterface {
public abstract String getDisplayName();
/**
* Get a graphical user interface to configure the auto trader.
* @return an AutoTraderGui object or null if there is no graphical
* user interface available.
*/
public abstract AutoTraderGui getGui();
public abstract JDialog getGuiConsole();
/**
* Get current configuration of the auto trader as JSON object.
* @return JSONObject containing the configuration
*/
public abstract JSONObject getConfig();
/**
* Set the configuration for auto trader by a JSON object.
* @param cfg the configuration
*/
public abstract void putConfig(JSONObject cfg);
/**
* Return the name of the auto trader.
* @return name
*/
public abstract String getName();
/**
* Initialize the auto trader
* @param se Exechange to trade on
* @param id
* @param name Name of auto trader
* @param money Money
* @param shares Number of shares
* @param cfg
*/
public void init(Exchange se, long id, String name, double money, double shares, JSONObject cfg);
public Exchange.Account getAccount();

View File

@ -55,6 +55,7 @@ public class ManTrader extends AutoTraderBase implements AccountListener, AutoTr
}
@Override
public void init(Exchange se, long id, String name, double money, double shares, JSONObject cfg) {
super.init(se, id, name, money, shares, cfg);
getAccount().setListener(this);