home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _8EA96EB72093405AB314E17F03A3C6BA < prev    next >
Encoding:
Text File  |  2003-04-03  |  1.3 KB  |  68 lines

  1. /**
  2.  * SchemaDouble.java
  3.  *
  4.  * This file was generated by XMLSPY 5 Enterprise Edition.
  5.  *
  6.  * YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
  7.  * OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
  8.  *
  9.  * Refer to the XMLSPY Documentation for further details.
  10.  * http://www.altova.com/xmlspy
  11.  */
  12.  
  13. package com.altova.xml.types;
  14.  
  15. public class SchemaDouble implements SchemaType {
  16.     protected double value;
  17.  
  18.     public SchemaDouble(double newvalue) {
  19.         value = newvalue;
  20.     }
  21.  
  22.     public SchemaDouble(String newvalue) {
  23.         value = Double.parseDouble(newvalue);
  24.     }
  25.  
  26.     public double getValue() {
  27.         return value;
  28.     }
  29.  
  30.     public void setValue(double newvalue) {
  31.         value = newvalue;
  32.     }
  33.  
  34.     public void setValue(String newvalue) {
  35.         value = Double.parseDouble(newvalue);
  36.     }
  37.  
  38.     public int hashCode() {
  39.         return (int)Double.doubleToLongBits(value);
  40.     }
  41.  
  42.     public boolean equals(Object obj) {
  43.         if (!(obj instanceof SchemaDouble))
  44.             return false;
  45.         return value == ((SchemaDouble)obj).value;
  46.     }
  47.  
  48.     public Object clone() {
  49.         return new SchemaDouble(value);
  50.     }
  51.  
  52.     public String toString() {
  53.         return Double.toString(value);
  54.     }
  55.  
  56.     public String asString() {
  57.         return toString();
  58.     }
  59.  
  60.     public int compareTo(Object obj) {
  61.         return compareTo((SchemaDouble)obj);
  62.     }
  63.  
  64.     public int compareTo(SchemaDouble obj) {
  65.         return Double.compare(value, obj.value);
  66.     }
  67. }
  68.