BrightSide Workbench Full Report + Source Code
org.turro.financials.operating.ContractItem Class Reference
Inheritance diagram for org.turro.financials.operating.ContractItem:
Collaboration diagram for org.turro.financials.operating.ContractItem:

Public Member Functions

 ContractItem (long id)
 
long getId ()
 
String getName ()
 
void setName (String name)
 
MonthItemSet getMonths ()
 
ValuesSet getValues ()
 
ParticipantSet getParticipants ()
 
int compareTo (ContractItem o)
 

Detailed Description

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

Definition at line 30 of file ContractItem.java.

Constructor & Destructor Documentation

◆ ContractItem()

org.turro.financials.operating.ContractItem.ContractItem ( long  id)

Definition at line 36 of file ContractItem.java.

36  {
37  this.id = id;
38  }

Member Function Documentation

◆ compareTo()

int org.turro.financials.operating.ContractItem.compareTo ( ContractItem  o)

Definition at line 88 of file ContractItem.java.

88  {
89  return CompareUtil.compare(id, o.id);
90  }

◆ getId()

long org.turro.financials.operating.ContractItem.getId ( )

Definition at line 40 of file ContractItem.java.

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

◆ getMonths()

MonthItemSet org.turro.financials.operating.ContractItem.getMonths ( )

Definition at line 59 of file ContractItem.java.

59  {
60  return months;
61  }

◆ getName()

String org.turro.financials.operating.ContractItem.getName ( )

Definition at line 44 of file ContractItem.java.

44  {
45  return name;
46  }

◆ getParticipants()

ParticipantSet org.turro.financials.operating.ContractItem.getParticipants ( )

Definition at line 75 of file ContractItem.java.

75  {
76  ParticipantSet values = new ParticipantSet();
77  for(MonthItem mi : getMonths()) {
78  for(ValueItem vi : mi.getMovements().getParticipants()) {
79  ValueItem acum = values.getItem(vi.getMajor());
80  acum.setName(vi.getName());
81  acum.setValue(acum.getValue() + vi.getValue());
82  }
83  }
84  return values;
85  }

◆ getValues()

ValuesSet org.turro.financials.operating.ContractItem.getValues ( )

Definition at line 63 of file ContractItem.java.

63  {
64  ValuesSet values = new ValuesSet();
65  for(MonthItem mi : getMonths()) {
66  for(ValueItem vi : mi.getMovements().getValues()) {
67  ValueItem acum = values.getItem(vi.getMajor());
68  acum.setName(vi.getName());
69  acum.setValue(acum.getValue() + vi.getValue());
70  }
71  }
72  return values;
73  }

◆ setName()

void org.turro.financials.operating.ContractItem.setName ( String  name)

Definition at line 48 of file ContractItem.java.

48  {
49  if(name == null) {
50  Dao dao = new FinancialsPU();
51  Contract c = dao.find(Contract.class, id);
52  if(c != null) {
53  name = c.getPartialDescription();
54  }
55  }
56  this.name = name;
57  }
Here is the call graph for this function:

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