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
TimeData.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.IHasOrder;
 15   
 import org.jbind.xml.core.data.ITime;
 16   
 import org.jbind.xml.core.data.ITimeData;
 17   
 import org.jbind.xml.msg.IConstraintViolations;
 18   
 import org.jbind.xml.msg.XmlException;
 19   
 
 20   
 public class TimeData extends AbstractDateOrTimeData implements ITimeData {
 21   
 
 22   
   private ITime myValue = null;
 23   
 
 24  7
   public TimeData() {}
 25   
 
 26  7
   protected void doAccept(String aString) throws XmlException {
 27  7
     super.doAccept(aString);
 28  7
     TimeStruct ts = acceptTime(aString, 0);
 29  7
     myValue = Time.create(ts.hour, ts.minute, ts.second, ts.fraction, ts.timeZone);
 30   
   }
 31   
 
 32  0
   public String getCanonicalForm_() {
 33  0
     return String.valueOf(myValue);
 34   
   }
 35   
 
 36  15
   public ITime getTime() {
 37  15
     return myValue;
 38   
   }
 39   
 
 40  0
   public void setTime(ITime aNewValue) throws XmlException {
 41  0
     ITime 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  3
   public boolean simpleStorageValueEquals(IAnyTypeData aData) {
 51  3
     return (aData instanceof ITimeData) && myValue.equals(((ITimeData)aData).getTime());
 52   
   }
 53   
 
 54  6
   public int simpleStorageValueHashCode() {
 55  6
     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 = (ITime)aValue;
 64   
   }
 65   
 
 66  0
   protected CompareResult doGetCompareResult(IHasOrder aData) {
 67  0
     return myValue.compareTo(((ITimeData)aData).getTime());
 68   
   }
 69   
 
 70   
 }
 71