BrightSide Workbench Full Report + Source Code
org.turro.financials.view.ViewSets Class Reference
Collaboration diagram for org.turro.financials.view.ViewSets:

Public Member Functions

 ViewSets ()
 
Set< RegisterViewgetGroupA ()
 
void setGroupA (Set< RegisterView > groupA)
 
Set< RegisterViewgetGroupB ()
 
void setGroupB (Set< RegisterView > groupB)
 
String getStringFilter ()
 
String getSqlWhereAB (String field)
 
String getSqlWhereA (String field)
 
String getSqlWhereB (String field)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 30 of file ViewSets.java.

Constructor & Destructor Documentation

◆ ViewSets()

org.turro.financials.view.ViewSets.ViewSets ( )

Definition at line 34 of file ViewSets.java.

34  {
35  groupA = new HashSet<RegisterView>();
36  groupB = new HashSet<RegisterView>();
37  groupA.add(ViewWrapper.getFormalView());
38  }
Here is the call graph for this function:

Member Function Documentation

◆ getGroupA()

Set<RegisterView> org.turro.financials.view.ViewSets.getGroupA ( )

Definition at line 40 of file ViewSets.java.

40  {
41  return groupA;
42  }
Here is the caller graph for this function:

◆ getGroupB()

Set<RegisterView> org.turro.financials.view.ViewSets.getGroupB ( )

Definition at line 49 of file ViewSets.java.

49  {
50  return groupB;
51  }
Here is the caller graph for this function:

◆ getSqlWhereA()

String org.turro.financials.view.ViewSets.getSqlWhereA ( String  field)

Definition at line 99 of file ViewSets.java.

99  {
100  PhraseBuilder pb = new PhraseBuilder();
101  if(!groupA.isEmpty()) {
102  pb.addWord("and " + field + " in (");
103  for(RegisterView rv : groupA) {
104  pb.addPendingSeparator(",");
105  pb.addWord(rv.getId() + "");
106  }
107  pb.cancelSeparator();
108  pb.addWord(")");
109  } else {
110  pb.addWord("and 1=2");
111  }
112  return pb.toString();
113  }
Here is the caller graph for this function:

◆ getSqlWhereAB()

String org.turro.financials.view.ViewSets.getSqlWhereAB ( String  field)

Definition at line 75 of file ViewSets.java.

75  {
76  PhraseBuilder pb = new PhraseBuilder();
77  if(!groupA.isEmpty()) {
78  pb.addWord("and (" + field + " in (");
79  for(RegisterView rv : groupA) {
80  pb.addPendingSeparator(",");
81  pb.addWord(rv.getId() + "");
82  }
83  pb.cancelSeparator();
84  pb.addWord(")");
85  if(!groupB.isEmpty()) {
86  pb.addWord("or " + field + " in (");
87  for(RegisterView rv : groupB) {
88  pb.addPendingSeparator(",");
89  pb.addWord(rv.getId() + "");
90  }
91  pb.cancelSeparator();
92  pb.addWord(")");
93  }
94  pb.addWord(")");
95  }
96  return pb.toString();
97  }
Here is the caller graph for this function:

◆ getSqlWhereB()

String org.turro.financials.view.ViewSets.getSqlWhereB ( String  field)

Definition at line 115 of file ViewSets.java.

115  {
116  PhraseBuilder pb = new PhraseBuilder();
117  if(!groupB.isEmpty()) {
118  pb.addWord("and " + field + " in (");
119  for(RegisterView rv : groupB) {
120  pb.addPendingSeparator(",");
121  pb.addWord(rv.getId() + "");
122  }
123  pb.cancelSeparator();
124  pb.addWord(")");
125  } else {
126  pb.addWord("and 1=2");
127  }
128  return pb.toString();
129  }
Here is the caller graph for this function:

◆ getStringFilter()

String org.turro.financials.view.ViewSets.getStringFilter ( )

Definition at line 58 of file ViewSets.java.

58  {
59  PhraseBuilder pb = new PhraseBuilder();
60  for(RegisterView v : groupA) {
61  pb.addWord(v.getName());
62  pb.addPendingSeparator(",");
63  }
64  if(!groupB.isEmpty()) {
65  pb.cancelSeparator();
66  pb.addWord("[vs.]");
67  for(RegisterView v : groupB) {
68  pb.addWord(v.getName());
69  pb.addPendingSeparator(",");
70  }
71  }
72  return pb.toString();
73  }
Here is the caller graph for this function:

◆ setGroupA()

void org.turro.financials.view.ViewSets.setGroupA ( Set< RegisterView groupA)

Definition at line 44 of file ViewSets.java.

44  {
45  this.groupA.clear();
46  this.groupA.addAll(groupA);
47  }

◆ setGroupB()

void org.turro.financials.view.ViewSets.setGroupB ( Set< RegisterView groupB)

Definition at line 53 of file ViewSets.java.

53  {
54  this.groupB.clear();
55  this.groupB.addAll(groupB);
56  }

The documentation for this class was generated from the following file: