BrightSide Workbench Full Report + Source Code
org.turro.contacts.proposal.MostProposedSet Class Reference
Inheritance diagram for org.turro.contacts.proposal.MostProposedSet:
Collaboration diagram for org.turro.contacts.proposal.MostProposedSet:

Classes

class  Proposition
 

Public Member Functions

void addProposition (Contact contact)
 
Contact getMostProposed ()
 

Detailed Description

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

Definition at line 27 of file MostProposedSet.java.

Member Function Documentation

◆ addProposition()

void org.turro.contacts.proposal.MostProposedSet.addProposition ( Contact  contact)

Definition at line 38 of file MostProposedSet.java.

38  {
39  boolean done = false;
40  for(Proposition p : this) {
41  if(p.contact.getId().equals(contact.getId())) {
42  p.count++;
43  done = true;
44  }
45  }
46  if(!done) {
47  add(new Proposition(contact, 1));
48  }
49  }
Here is the call graph for this function:

◆ getMostProposed()

Contact org.turro.contacts.proposal.MostProposedSet.getMostProposed ( )

Definition at line 51 of file MostProposedSet.java.

51  {
52  Contact contact = null;
53  int most = 0;
54  for(Proposition p : this) {
55  if(p.count > most) {
56  most = p.count;
57  contact = p.contact;
58  }
59  }
60  return contact;
61  }

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