Logo Search packages:      
Sourcecode: pcalendar version File versions  Download package

void net::sf::linuxorg::pcal::engine::Engine::swapSympthomValues ( int  sympthomIndex,
int  valueIndex1,
int  valueIndex2 
) [inline]

Swaps two values of a single sympthom

Parameters:
sympthomIndex
valueIndex1
valueIndex2

Definition at line 1628 of file Engine.java.

References getAllDateIntegers(), net::sf::linuxorg::pcal::engine::BBTSympthomsSetDefinition::getSympthoms(), net::sf::linuxorg::pcal::engine::BBTSympthomsSetDefinition::getSympthomValue(), modified, net::sf::linuxorg::pcal::engine::BBTSympthomsSetDefinition::setSypmthomValue(), and sympthomsDefinition.

                                                                                          {
            if((sympthomIndex >=0) && (sympthomIndex < sympthomsDefinition.getSympthoms().length)) {        
                  String tmpValue = sympthomsDefinition.getSympthomValue(sympthomIndex, valueIndex1);
                  sympthomsDefinition.setSypmthomValue(sympthomIndex, valueIndex1, sympthomsDefinition.getSympthomValue(sympthomIndex, valueIndex2));
                  sympthomsDefinition.setSypmthomValue(sympthomIndex, valueIndex2, tmpValue);

                  // update the date-integets pairs according to this change
                  for(DateIntsContainer intCnt: PCalendar.engine.getAllDateIntegers().values()) {
                        Integer tempInt = intCnt.getIntValue(sympthomIndex);
                        if(tempInt!=null) {
                              if(tempInt.equals(valueIndex1)) {
                                    intCnt.setIntValue(sympthomIndex, valueIndex2);
                              } else 
                                    if(tempInt.equals(valueIndex2)) {
                                          intCnt.setIntValue(sympthomIndex, valueIndex1);
                                    } 
                        }
                  }
                  modified = true;
            }
      }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index