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

  1. /**
  2.  * SchemaByte.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 SchemaByte implements SchemaType {
  16.     protected byte value;
  17.  
  18.     public SchemaByte(int newvalue) {
  19.         value = (byte)newvalue;
  20.     }
  21.  
  22.     public SchemaByte(String newvalue) {
  23.         value = Byte.parseByte(newvalue);
  24.     }
  25.  
  26.     public byte getValue() {
  27.         return value;
  28.     }
  29.  
  30.     public void setValue(int newvalue) {
  31.         value = (byte)newvalue;
  32.     }
  33.  
  34.     public void setValue(String newvalue) {
  35.         value = Byte.parseByte(newvalue);
  36.     }
  37.  
  38.     public int hashCode() {
  39.         return value;
  40.     }
  41.  
  42.     public boolean equals(Object obj) {
  43.         if (!(obj instanceof SchemaByte))
  44.             return false;
  45.         return value == ((SchemaByte)obj).value;
  46.     }
  47.  
  48.     public Object clone() {
  49.         return new SchemaByte(value);
  50.     }
  51.  
  52.     public String toString() {
  53.         return Byte.toString(value);
  54.     }
  55.  
  56.     public String asString() {
  57.         return toString();
  58.     }
  59.  
  60.     public int compareTo(Object obj) {
  61.         return compareTo((SchemaByte)obj);
  62.     }
  63.  
  64.     public int compareTo(SchemaByte obj) {
  65.         return new Byte(value).compareTo(new Byte(obj.value));
  66.     }
  67. }
  68.