001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/tags/2.1/src/org/deegree/framework/util/UUID.java $
002    /*
003    
004    This class orginaly has been part of the apache derby project. It has 
005    slightly been changed to match the requirements of deegree.
006    
007       Derby - Class org.apache.derby.catalog.UUID
008    
009       Copyright 1997, 2004 The Apache Software Foundation or its licensors, as applicable.
010    
011       Licensed under the Apache License, Version 2.0 (the "License");
012       you may not use this file except in compliance with the License.
013       You may obtain a copy of the License at
014    
015          http://www.apache.org/licenses/LICENSE-2.0
016    
017       Unless required by applicable law or agreed to in writing, software
018       distributed under the License is distributed on an "AS IS" BASIS,
019       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
020       See the License for the specific language governing permissions and
021       limitations under the License.
022    
023     */
024    
025    package org.deegree.framework.util;
026    
027    /**
028    
029     An interface for accessing Cloudscape UUIDs, unique identifiers.
030                    
031            <p>The values in the
032            system catalog held in ID columns with a type of CHAR(36) are the
033            string representations of these UUIDs.
034    
035            <p>A UUID implements equals() and hashCode based on value equality.
036    
037     */
038    
039    public interface UUID extends java.io.Externalizable
040    {
041            /**
042              UUID_BYTE_LENGTH
043    
044              The number of bytes in the array toByteArray returns.
045              */
046            static int UUID_BYTE_LENGTH = 16;
047            
048            /**
049                    Produce a string representation of this UUID which
050                    is suitable for use as a unique ANSI identifier.
051             */
052            String toANSIidentifier();
053    
054            /**
055                Produce a byte array representation of this UUID
056                    which can be passed to UUIDFactory.recreateUUID later
057                    on to reconstruct it.
058            */
059            byte[] toByteArray();
060    
061            /**
062              Clone this UUID.
063    
064              @return       a copy of this UUID
065              */
066            UUID cloneMe();
067    
068            /**
069              Create a hex string representation of this UUID.
070              */
071            String toHexString();
072    }
073    
074    /* ********************************************************************
075    Changes to this class. What the people have been up to:
076    $Log$
077    Revision 1.2  2006/07/12 14:46:17  poth
078    comment footer added
079    
080    ********************************************************************** */