| 1 | /* |
|---|
| 2 | * $Id$ |
|---|
| 3 | * |
|---|
| 4 | * Copyright 2006, The jCoderZ.org Project. All rights reserved. |
|---|
| 5 | * |
|---|
| 6 | * Redistribution and use in source and binary forms, with or without |
|---|
| 7 | * modification, are permitted provided that the following conditions are |
|---|
| 8 | * met: |
|---|
| 9 | * |
|---|
| 10 | * * Redistributions of source code must retain the above copyright |
|---|
| 11 | * notice, this list of conditions and the following disclaimer. |
|---|
| 12 | * * Redistributions in binary form must reproduce the above |
|---|
| 13 | * copyright notice, this list of conditions and the following |
|---|
| 14 | * disclaimer in the documentation and/or other materials |
|---|
| 15 | * provided with the distribution. |
|---|
| 16 | * * Neither the name of the jCoderZ.org Project nor the names of |
|---|
| 17 | * its contributors may be used to endorse or promote products |
|---|
| 18 | * derived from this software without specific prior written |
|---|
| 19 | * permission. |
|---|
| 20 | * |
|---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND |
|---|
| 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|---|
| 24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS |
|---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
|---|
| 28 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
|---|
| 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|---|
| 30 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
|---|
| 31 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|---|
| 32 | */ |
|---|
| 33 | package org.jcoderz.commons.util; |
|---|
| 34 | |
|---|
| 35 | import java.util.Locale; |
|---|
| 36 | |
|---|
| 37 | /** |
|---|
| 38 | * Utility class, keeps all jCoderZ wide constants. |
|---|
| 39 | * |
|---|
| 40 | * @author Andreas Mandel |
|---|
| 41 | * @author Michael Griffel |
|---|
| 42 | */ |
|---|
| 43 | public final class Constants |
|---|
| 44 | { |
|---|
| 45 | /** Name of the oracle driver class. */ |
|---|
| 46 | public static final String ORACLE_DRIVER_CLASS_NAME |
|---|
| 47 | = "oracle.jdbc.OracleDriver"; |
|---|
| 48 | |
|---|
| 49 | /** Number of bits per bytes. */ |
|---|
| 50 | public static final int BITS_PER_BYTE = 8; |
|---|
| 51 | |
|---|
| 52 | /** Number of bytes per int (integer). */ |
|---|
| 53 | public static final int BYTES_PER_INT = 4; |
|---|
| 54 | |
|---|
| 55 | /** Mask bytes. */ |
|---|
| 56 | public static final int BYTE_MASK = 0xFF; |
|---|
| 57 | |
|---|
| 58 | /** number of bits for an integer. */ |
|---|
| 59 | public static final int BITS_PER_INTEGER = BITS_PER_BYTE * BYTES_PER_INT; |
|---|
| 60 | |
|---|
| 61 | /** Number of bytes per kilo byte. */ |
|---|
| 62 | public static final int BYTES_PER_KILO_BYTE = 1024; |
|---|
| 63 | |
|---|
| 64 | /** space character. */ |
|---|
| 65 | public static final char SPACE_CHAR = ' '; |
|---|
| 66 | |
|---|
| 67 | /** tab character. */ |
|---|
| 68 | public static final char TAB_CHAR = '\t'; |
|---|
| 69 | |
|---|
| 70 | /** line feed character. */ |
|---|
| 71 | public static final char LINE_FEED_CHAR = '\n'; |
|---|
| 72 | |
|---|
| 73 | /** carriage return character. */ |
|---|
| 74 | public static final char CARRIAGE_RETURN_CHAR = '\r'; |
|---|
| 75 | |
|---|
| 76 | /** The line separator. */ |
|---|
| 77 | public static final String LINE_SEPARATOR |
|---|
| 78 | = System.getProperty("line.separator"); |
|---|
| 79 | |
|---|
| 80 | /** The UTF-8 encoding String. */ |
|---|
| 81 | public static final String ENCODING_UTF8 = "UTF-8"; |
|---|
| 82 | |
|---|
| 83 | /** The ASCII encoding String. */ |
|---|
| 84 | public static final String ENCODING_ASCII = "ASCII"; |
|---|
| 85 | |
|---|
| 86 | /** |
|---|
| 87 | * A central Locale to be used for string case conversions, |
|---|
| 88 | * date/time conversions etc. |
|---|
| 89 | * Used as a country independent locale for locale independent |
|---|
| 90 | * conversions. |
|---|
| 91 | */ |
|---|
| 92 | public static final Locale SYSTEM_LOCALE = Locale.US; |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | /** constants class, no public instances allowed. */ |
|---|
| 96 | private Constants () |
|---|
| 97 | { |
|---|
| 98 | // constants class -- holds only constants |
|---|
| 99 | } |
|---|
| 100 | } |
|---|