KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > datatypes > xsd > impl > XSDByteType


1 /******************************************************************
2  * File: XSDByteType.java
3  * Created by: Dave Reynolds
4  * Created on: 10-Dec-02
5  *
6  * (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
7  * [See end of file]
8  * $Id: XSDByteType.java,v 1.7 2005/02/21 12:02:20 andy_seaborne Exp $
9  *****************************************************************/

10 package com.hp.hpl.jena.datatypes.xsd.impl;
11
12 import com.hp.hpl.jena.graph.impl.LiteralLabel;
13
14 /**
15  * Datatype template used to define XSD int types
16  *
17  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
18  * @version $Revision: 1.7 $ on $Date: 2005/02/21 12:02:20 $
19  */

20 public class XSDByteType extends XSDBaseNumericType {
21
22     /**
23      * Constructor.
24      * @param typeName the name of the XSD type to be instantiated, this is
25      * used to lookup a type definition from the Xerces schema factory.
26      */

27     public XSDByteType(String JavaDoc typeName) {
28         super(typeName);
29     }
30     
31     /**
32      * Constructor.
33      * @param typeName the name of the XSD type to be instantiated, this is
34      * used to lookup a type definition from the Xerces schema factory.
35      * @param javaClass the java class for which this xsd type is to be
36      * treated as the cannonical representation
37      */

38     public XSDByteType(String JavaDoc typeName, Class JavaDoc javaClass) {
39         super(typeName, javaClass);
40     }
41         
42     /**
43      * Compares two instances of values of the given datatype.
44      * This ignores lang tags and just uses the java.lang.Number
45      * equality.
46      */

47     public boolean isEqual(LiteralLabel value1, LiteralLabel value2) {
48        return value1.getValue().equals(value2.getValue());
49     }
50
51 }
52
53 /*
54     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
55     All rights reserved.
56
57     Redistribution and use in source and binary forms, with or without
58     modification, are permitted provided that the following conditions
59     are met:
60
61     1. Redistributions of source code must retain the above copyright
62        notice, this list of conditions and the following disclaimer.
63
64     2. Redistributions in binary form must reproduce the above copyright
65        notice, this list of conditions and the following disclaimer in the
66        documentation and/or other materials provided with the distribution.
67
68     3. The name of the author may not be used to endorse or promote products
69        derived from this software without specific prior written permission.
70
71     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
72     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
73     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
74     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
75     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
76     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
77     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
78     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
79     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
80     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
81 */

82
Popular Tags