Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 71   Methods: 10
NCLOC: 47   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
DateTimeData.java 0% 37,5% 50% 39,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.IDateTime;
 15   
 import org.jbind.xml.core.data.IDateTimeData;
 16   
 import org.jbind.xml.core.data.IHasOrder;
 17   
 import org.jbind.xml.msg.IConstraintViolations;
 18   
 import org.jbind.xml.msg.XmlException;
 19   
 
 20   
 public class DateTimeData extends AbstractDateOrTimeData implements IDateTimeData {
 21   
 
 22   
   private IDateTime myValue = null;
 23   
 
 24  11
   public DateTimeData() {}
 25   
 
 26  11
   protected void doAccept(String aString) throws XmlException {
 27  11
     super.doAccept(aString);
 28  11
     DateTimeStruct s = acceptDateTime(aString);
 29  11
     myValue = DateTime.create(s.sign, s.year, s.month, s.day, s.hour, s.minute, s.second, s.fraction, s.timeZone);
 30   
   }
 31   
 
 32  0
   public String getCanonicalForm_() {
 33  0
     return String.valueOf(myValue);
 34   
   }
 35   
 
 36  35
   public IDateTime getDateTime() {
 37  35
     return myValue;
 38   
   }
 39   
 
 40  0
   public void setDateTime(IDateTime aNewValue) throws XmlException {
 41  0
     IDateTime oldValue = myValue;
 42  0
     myValue = aNewValue;
 43  0
     IConstraintViolations violations = completeSimpleStorageAssignment_();
 44  0
     if (!violations.isEmpty()) {
 45  0
       myValue = oldValue;
 46  0
       throw new XmlException(violations);
 47   
     }
 48   
   }
 49   
 
 50  5
   public boolean simpleStorageValueEquals(IAnyTypeData aData) {
 51  5
     return (aData instanceof IDateTimeData) && myValue.equals(((IDateTimeData)aData).getDateTime());
 52   
   }
 53   
 
 54  10
   public int simpleStorageValueHashCode() {
 55  10
     return myValue.hashCode();
 56   
   }
 57   
 
 58  0
   public Object getSimpleStorageObject() {
 59  0
     return myValue;
 60   
   }
 61   
 
 62  0
   public void setSimpleStorageObject(Object aValue) {
 63  0
     myValue = (IDateTime)aValue;
 64   
   }
 65   
 
 66  0
   protected CompareResult doGetCompareResult(IHasOrder aData) {
 67  0
     return myValue.compareTo(((IDateTimeData)aData).getDateTime());
 68   
   }
 69   
 
 70   
 }
 71