Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 83   Methods: 10
NCLOC: 59   Classes: 1
This license of Clover is provided to support the development of JBind only. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover.
 
 Source file Conditionals Statements Methods TOTAL
GMonthDayData.java 0% 59,3% 40% 51,3%
 1   
 /*
 2   
  * JBind
 3   
  *
 4   
  * Copyright (c) by Stefan Wachter. All rights reserved.
 5   
  *
 6   
  * Usage, modification, and redistribution is subject to license terms that are
 7   
  * available at 'http://www.jbind.org'. The JBind license is like the
 8   
  * 'Apache Software License V 1.1'.
 9   
  */
 10   
 package org.jbind.xml.instance.data;
 11   
 
 12   
 import org.jbind.xml.core.data.CompareResult;
 13   
 import org.jbind.xml.core.data.IAnyTypeData;
 14   
 import org.jbind.xml.core.data.IGMonthDay;
 15   
 import org.jbind.xml.core.data.IGMonthDayData;
 16   
 import org.jbind.xml.core.data.IHasOrder;
 17   
 import org.jbind.xml.core.data.ITimeZone;
 18   
 import org.jbind.xml.msg.IConstraintViolations;
 19   
 import org.jbind.xml.msg.XmlException;
 20   
 
 21   
 public class GMonthDayData extends AbstractDateOrTimeData implements IGMonthDayData {
 22   
 
 23   
   private IGMonthDay myValue = null;
 24   
 
 25  1
   public GMonthDayData() {}
 26   
 
 27  1
   protected void doAccept(String aString) throws XmlException {
 28  1
     super.doAccept(aString);
 29  1
     int idx = 0;
 30  1
     parseChar(aString, idx, '-');
 31  1
     idx++;
 32  1
     parseChar(aString, idx, '-');
 33  1
     idx++;
 34  1
     int month = parseInt(aString, idx, 2);
 35  1
     idx += 2;
 36  1
     parseChar(aString, idx, '-');
 37  1
     idx++;
 38  1
     int day = parseInt(aString, idx, 2);
 39  1
     idx += 2;
 40  1
     ITimeZone timeZone = acceptTimeZone(aString, idx);
 41  1
     myValue = new GMonthDay(month, day, timeZone);
 42   
   }
 43   
 
 44  0
   public String getCanonicalForm_() {
 45  0
     return String.valueOf(myValue);
 46   
   }
 47   
 
 48  3
   public IGMonthDay getGMonthDay() {
 49  3
     return myValue;
 50   
   }
 51   
 
 52  0
   public void setGMonthDay(IGMonthDay aNewValue) throws XmlException {
 53  0
     IGMonthDay oldValue = myValue;
 54  0
     myValue = aNewValue;
 55  0
     IConstraintViolations violations = completeSimpleStorageAssignment_();
 56  0
     if (!violations.isEmpty()) {
 57  0
       myValue = oldValue;
 58  0
       throw new XmlException(violations);
 59   
     }
 60   
   }
 61   
 
 62  0
   public boolean simpleStorageValueEquals(IAnyTypeData aData) {
 63  0
     return (aData instanceof IGMonthDayData) && myValue.equals(((IGMonthDayData)aData).getGMonthDay());
 64   
   }
 65   
 
 66  0
   public int simpleStorageValueHashCode() {
 67  0
     return myValue.hashCode();
 68   
   }
 69   
 
 70  1
   public Object getSimpleStorageObject() {
 71  1
     return myValue;
 72   
   }
 73   
 
 74  0
   public void setSimpleStorageObject(Object aValue) {
 75  0
     myValue = (IGMonthDay)aValue;
 76   
   }
 77   
 
 78  0
   protected CompareResult doGetCompareResult(IHasOrder aData) {
 79  0
     return myValue.compareTo(((IGMonthDayData)aData).getGMonthDay());
 80   
   }
 81   
 
 82   
 }
 83