root/InOutExpositor/oDet.pde

Revision 5972babe7c40454704b75ea69ba2e12d80927eaa, 1.8 kB (checked in by Robin Gareus <robin@…>, 3 years ago)

fixed expositor to compile w/processing-1.0.9

  • Property mode set to 100644
Line 
1////////////////////////////////////////////////////////
2// Determine OUT
3class Determinant {
4  boolean on ;
5  int type ;
6  String name ;
7  String descr ;
8
9  int N ;
10  Vector T ; // Vector of Tags
11
12  int pId ;
13
14  Determinant(int t, String tags, boolean doTags) {
15    type = t ;
16    setString( tags, doTags ) ;
17  }
18  /////////////////////////////////////////////////////////////////////
19  void addTag(String newTag, int val) {
20      addTagInVector(T, newTag, val) ;
21  }
22  void setString(String inStr, boolean doTags) {
23    if(!inStr.equals("")) {
24      try{
25        on = false ;
26        N = -1 ;
27        if(doTags) T = new Vector() ;
28        String[] pl = split(inStr,aSepa) ;
29        for(int p=0;p<pl.length;p++) { // for all given parameter, get param & value
30          String[] spl = split(pl[p],"=") ;
31          String par = spl[0] ;
32          String val = spl[1] ;
33          //////////////////////////////////////////
34          if(par.equals("N")) {
35            N = int(val) ;
36            if(N!=0) on = true ;
37          }
38          if(doTags && par.equals("T")) {
39            T = makeTagsFromString(val) ;
40          }
41          //////////////////////////////////////////
42        }
43      }
44      catch(Exception e) {
45        print("VOLONTE OUT : Parsing problem"+e+"\n") ;
46        T=new Vector() ;
47      }
48    }
49  }
50  ///////////////////////////////////////////////////
51
52  ///////////////////////////////////////////////////
53  String getString() {
54    String res = "" ;
55    if(N!=-1) res += "N="+N+aSepa ;
56    if(T.size()!=0) res += "T="+makeStringFromTags(T)+aSepa ;
57    if(res.length()!=0) res = res.substring(0,res.length()-1) ;
58    return res ;
59  }
60  String getLisibleTagString() {
61    String res = "" ;
62  for(int u=0;u<T.size();u++) {
63    res += ((Tag)T.elementAt(u)).tag + " " ;
64  }
65  return res ;
66  }
67}
68
69
70
71
72
Note: See TracBrowser for help on using the browser.