|
|||||||||||||||||||
| 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 | |||||||||||||||
| AbstractShortData.java | 0% | 16,7% | 50% | 16,7% |
|
||||||||||||||
| 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.IShortData; |
|
| 13 |
import org.jbind.xml.msg.XmlException; |
|
| 14 |
import org.jbind.xml.msg.XmlMessages; |
|
| 15 |
|
|
| 16 |
public abstract class AbstractShortData extends AbstractIntData implements IShortData {
|
|
| 17 |
|
|
| 18 | 4 |
public int getInt() {
|
| 19 | 4 |
return getShort(); |
| 20 |
} |
|
| 21 |
|
|
| 22 | 0 |
public void setInt(int aValue) throws XmlException {
|
| 23 | 0 |
if (aValue > Short.MAX_VALUE) {
|
| 24 | 0 |
throw new XmlException(XmlMessages.numberTooLarge(String.valueOf(aValue), null)); |
| 25 |
} |
|
| 26 | 0 |
if (aValue < Short.MIN_VALUE) {
|
| 27 | 0 |
throw new XmlException(XmlMessages.numberTooSmall(String.valueOf(aValue), null)); |
| 28 |
} |
|
| 29 | 0 |
setShort((short)aValue); |
| 30 |
} |
|
| 31 |
|
|
| 32 |
} |
|
| 33 |
|
|
||||||||||