Class TSActEv

java.lang.Object
  extended by TSOpts
      extended by TSActEv
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TSActEv>

 class TSActEv
extends TSOpts
implements java.lang.Comparable<TSActEv>

.

======================================================================
 Class TSActEv -- Attribute-defininition within a Activity
   Type: Events     ('Activity-Event')
 ##TSActEv (Eyecatcher)
======================================================================
 


Field Summary
protected static java.lang.String[] actNme
           
protected static int AMsk
           
private  int ID
           
protected static java.lang.String IdStr
           
private  TSRefC Itm
           
protected static int LMsk
           
private  int Lvl
           
protected static int[] modMsk
           
private  java.lang.String Name
           
private  TSQPos Pos
           
private  java.util.ArrayList<TSRefC> Rslt
           
private  double Spd
           
private  TSRefC StStp
           
private  java.lang.String[] Text
           
private  int Tme
           
protected static int TMsk
           
private  boolean ToS
           
private  int Typ
           
protected static java.lang.String[] typNme
           
private  java.util.ArrayList<TSRefC> WgnT
           
 
Constructor Summary
protected TSActEv()
          .
protected TSActEv(int t)
          .
 
Method Summary
protected  int addRslt(TSRefC nR)
          .
protected  int chgID(int nV)
          .
protected  int chgLvl(int nV)
          .
protected  java.lang.String chgNme(java.lang.String nV)
          .
protected  double chgSpd(double nV)
          .
protected  TSRefC chgStStp(TSRefC nR)
          .
protected  int chgTme(int nT)
          .
protected  java.lang.String chgTxt(int nr, java.lang.String nV)
          .
 int compareTo(TSActEv vE)
          .
protected  java.util.Iterator<java.lang.String> crDef(int t, java.util.ArrayList<java.lang.String> LneT, java.lang.String prfx)
          .
protected  TSTrItm fndTrI(TSRoute cR)
          .
protected  java.lang.String fndWrld(java.util.TreeSet<TSQuad> QDf)
          .
protected static java.lang.String getAct(int id)
          .
protected  java.util.Iterator<TSRefC> getRslt()
          .
protected  java.lang.String getTyp(java.lang.String prfx)
          .
protected  java.util.ArrayList<TSRefC> getWgn(int c)
          .
protected  int setItm(TSRefC nR)
          .
protected  TSQPos setPos(TSQPos cP)
          .
protected  boolean setToS()
          .
protected  java.lang.String toStr()
          .
 
Methods inherited from class TSOpts
$init, chkMsk, chkMsk, clrMsk, clrMsk, cntMsk, cntMsk, fndMsk, getMsk, orMsk, orMsk, prtMsk, resMsk, setMsk, setMsk, tstMsk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IdStr

protected static final java.lang.String IdStr
See Also:
Constant Field Values

TMsk

protected static final int TMsk
See Also:
Constant Field Values

LMsk

protected static final int LMsk
See Also:
Constant Field Values

AMsk

protected static final int AMsk
See Also:
Constant Field Values

modMsk

protected static final int[] modMsk

typNme

protected static final java.lang.String[] typNme

actNme

protected static final java.lang.String[] actNme

Typ

private int Typ

ID

private int ID

Lvl

private int Lvl

Tme

private int Tme

Spd

private double Spd

ToS

private boolean ToS

Name

private java.lang.String Name

Pos

private TSQPos Pos

Text

private java.lang.String[] Text

Rslt

private java.util.ArrayList<TSRefC> Rslt

WgnT

private java.util.ArrayList<TSRefC> WgnT

StStp

private TSRefC StStp

Itm

private TSRefC Itm
Constructor Detail

TSActEv

protected TSActEv()
.
 Options used within optionsmask of 'TSOpt':
   (Assignment 0..24 is also used within validation-mask of events)
   0 'EventTypeTime'
   1 'EventTypeLocation'
   2 'EventTypeAllStops'
   3 'EventTypePickUpPassengers'
   4 Aufnahme machen
   5 'EventTypeReachSpeed'
   6 'EventTypePickUpWagons'
   7 'EventTypeDropOffWagonsAtLocation'
   8 'EventTypeAssembleTrain'
   9 'EventTypeAssembleTrainAtLocation'
      bitnumber also defines 'type of event' (until here)
  10 'ID'
  11 'Activation_Level'
  12 'Outcomes'
  13 'TextToDisplayOnCompletionIfTriggered'
  14 'TextToDisplayOnCompletionIfNotTriggered'
  15 'TextToDisplayDescriptionOfTask'
  16 'Reversable_Event'
  17 'Name'
  18 'Time'
  19 'Location'
  20 'TriggerOnStop'
  21 'StationStop'
  22 'Speed'
  23 'Wagon_List'
  24 'SidingItem'
      (This assignment is also used within validation-mask of events)
  31 Reserved for temporary usage
 Within 'Outcomes' the following 'Action-ID' is used:
   0 'IncActLevel' ()
   1 'DecActLevel' ()
   2 'ActivateEvent' ()
   3 'RestoreActLevel' ()
   4 'DisplayMessage' ()
   5 'ActivitySuccess'
   6 'ActivityFail' ()
   7 'StartIgnoringSpeedLimits'
   8 'StopIgnoringSpeedLimits'
  'Action-ID' is stored in 'ix'-field of TSRefC-class
=====================================================================
 Constructor: (1) create default-entry
=====================================================================
  


TSActEv

protected TSActEv(int t)
.
=====================================================================
 Constructor: (2) create standard-entry
=====================================================================
  

Method Detail

addRslt

protected final int addRslt(TSRefC nR)
.
=====================================================================
 Methode "addRslt"
 Add an entry to the 'Result'-Table ('Outcomes')
 Return new 'current size' of table (<=4)
 No entry will be added if 'cV==null' (information-Hiding)
 ##addRslt.TSActEv (Eyecatcher)
=====================================================================
  


chgID

protected final int chgID(int nV)
.
=====================================================================
 Method "chgID"
 Change value of event-ID or only 'return it'
 ##chgID.TSActEv (Eyecatcher)
=====================================================================
  


chgLvl

protected final int chgLvl(int nV)
.
=====================================================================
 Method "chgLvl"
 Change value of 'Activation_Level' or only 'return it'
 ##chgLvl.TSActEv (Eyecatcher)
=====================================================================
  


chgNme

protected final java.lang.String chgNme(java.lang.String nV)
.
=====================================================================
 Methode "chgNme"
 Change name of event or return it
 No change of Name will occur if 'cV==null' (information-Hiding)
 ##chgNme.TSActEv (Eyecatcher)
=====================================================================
  


chgSpd

protected final double chgSpd(double nV)
.
=====================================================================
 Methode "chgSpd"
 Change 'Speed'-value or return it
 No change of data will occur if 'cV==NaN' (information-Hiding)
 ##chgSpd.TSActEv (Eyecatcher)
=====================================================================
  


chgStStp

protected final TSRefC chgStStp(TSRefC nR)
.
=====================================================================
 Method "chgStStp"
 Modify or return 'StationStop'-reference
 ##chgStStp.TSActEv (Eyecatcher)
=====================================================================
  


chgTme

protected final int chgTme(int nT)
.
=====================================================================
 Method "chgTme"
 Change 'Timer'-value or only 'return it'
 ##chgTme.TSActEv (Eyecatcher)
=====================================================================
  


chgTxt

protected final java.lang.String chgTxt(int nr,
                                        java.lang.String nV)
.
=====================================================================
 Methode "chgTxt"
 Change text-definitions ('Trigger-Text',...)  or return it
 No change of text will occur if 'cV==null' (information-Hiding)
 ##chgTxt.TSActEv (Eyecatcher)
=====================================================================
  


compareTo

public final int compareTo(TSActEv vE)
.
=====================================================================
 Method "compareTo"
 Method is used to sort Elements
 Attention: Name of this Methode is requested by Interface
           'Comparable'. Results need NOT be 0,1,-1
 Note: This class has a natural ordering that is
       inconsistent with equals.
 ##compareTo.TSActEv (Eyecatcher)
=====================================================================
  

Specified by:
compareTo in interface java.lang.Comparable<TSActEv>

crDef

protected final java.util.Iterator<java.lang.String> crDef(int t,
                                                           java.util.ArrayList<java.lang.String> LneT,
                                                           java.lang.String prfx)
.
=====================================================================
 Method "crDef"
 Create an output-line-block due to requested type
 Attention: Function 21 (Type 'StationStop') also refers to global
            field 'TSUtil.RetVal', which must contain the
            'StationStop'-table of the 'Player-Service'.
 ##crDef.TSActEv (Eyecatcher)
=====================================================================
  


fndTrI

protected final TSTrItm fndTrI(TSRoute cR)
.
=====================================================================
 Method "fndTrI"
 Search TrItem-Database for TrItem-reference within 'Itm'.
   Register result within 'cRef'-entry if found.
 Method returns the connected TrItem-element to enable further
   checking.
 Method also stores current TrItem-NUMBER to 'RetVal' for error-
   processing if requested element is not found.
 ##fndTrI.TSActEv (Eyecatcher)
=====================================================================
  


fndWrld

protected final java.lang.String fndWrld(java.util.TreeSet<TSQuad> QDf)
.
=====================================================================
 Method "fndWrld"
 Search world-definiton of 'Location'-value and insert it
 Method returns an error-marker or 'null' if no error
 ##fndWrld.TSActEv (Eyecatcher)
=====================================================================
  


getAct

protected static final java.lang.String getAct(int id)
.
=====================================================================
 Methode "getAct" (static)
 Get name of an action due to its ID ('Outcomes')
 ##getAct.TSActEv (Eyecatcher)
=====================================================================
  


getRslt

protected final java.util.Iterator<TSRefC> getRslt()
.
=====================================================================
 Methode "getRslt"
 Get an iterator for the 'Result'-Table ('Outcomes')
 ##getRslt.TSActEv (Eyecatcher)
=====================================================================
  


getTyp

protected final java.lang.String getTyp(java.lang.String prfx)
.
=====================================================================
 Methode "getTyp"
 Returns type of eevent to be used as an output-line
 ##getTyp.TSActEv (Eyecatcher)
=====================================================================
  


getWgn

protected final java.util.ArrayList<TSRefC> getWgn(int c)
.
=====================================================================
 Methode "getWgn"
 Returns current array of 'Wagon_List'-References, which is of
   type 'TSRefC'. If it is requested (c>0), it is created even if
   it is already available.
 ##getWgn.TSActEv (Eyecatcher)
=====================================================================
  


setItm

protected final int setItm(TSRefC nR)
.
=====================================================================
 Method "setItm"
 Set 'SidingItem'-reference.
 Return number of (old) reference if already set
 Attention: TrItem-reference is modified in any case
 ##setItm.TSActEv (Eyecatcher)
=====================================================================
  


setPos

protected final TSQPos setPos(TSQPos cP)
.
=====================================================================
 Method "setPos"
 Replace 'Location'-reference.
 Current value is overwritten in any case. However, old value is
   returned.
 ##setPos.TSActEv (Eyecatcher)
=====================================================================
  


setToS

protected final boolean setToS()
.
=====================================================================
 Method "setToS"
 Activate 'TriggerOnStop'.
 Current value is overwritten in any case. However, old value is
   returned.
 ##setToS.TSActEv (Eyecatcher)
=====================================================================
  


toStr

protected final java.lang.String toStr()
.
=====================================================================
 Method "toStr"
 Build a string-representation of all values of this class
 ##toStr.TSActEv (Eyecatcher)
=====================================================================
  

Overrides:
toStr in class TSOpts