2362N/A * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A ******************************************************************************* 1091N/A * (C) Copyright IBM Corp. and others, 1996-2009 - All Rights Reserved * 0N/A * The original version of this source code and documentation is copyrighted * 0N/A * and owned by IBM, These materials are provided under terms of a License * 0N/A * Agreement between IBM and Sun. This technology is protected by multiple * 0N/A * US and International patents. This notice and attribution to IBM may not * 0N/A ******************************************************************************* 0N/A * Class to store version numbers of the form major.minor.milli.micro. 0N/A // public methods ------------------------------------------------------ 0N/A * Returns an instance of VersionInfo with the argument version. 0N/A * @param version version String in the format of "major.minor.milli.micro" 0N/A * or "major.minor.milli" or "major.minor" or "major", 0N/A * where major, minor, milli, micro are non-negative numbers 0N/A * <= 255. If the trailing version numbers are 0N/A * not specified they are taken as 0s. E.g. Version "3.1" is 0N/A * equivalent to "3.1.0.0". 0N/A * @return an instance of VersionInfo with the argument version. 0N/A * @exception throws an IllegalArgumentException when the argument version 0N/A * is not in the right format 0N/A if (c <
0 || c >
9) {
0N/A "Invalid version number: String '" +
version +
"' exceeds version format");
0N/A for (
int i =
0; i <
4; i ++) {
0N/A * Returns an instance of VersionInfo with the argument version. 0N/A * @param major major version, non-negative number <= 255. 0N/A * @param minor minor version, non-negative number <= 255. 0N/A * @param milli milli version, non-negative number <= 255. 0N/A * @param micro micro version, non-negative number <= 255. 0N/A * @exception throws an IllegalArgumentException when either arguments are 0N/A // checks if it is in the hashmap 0N/A * Compares other with this VersionInfo. 0N/A * @param other VersionInfo to be compared 0N/A * @return 0 if the argument is a VersionInfo object that has version 0N/A * information equals to this object. 0N/A * Less than 0 if the argument is a VersionInfo object that has 0N/A * version information greater than this object. 0N/A * Greater than 0 if the argument is a VersionInfo object that 0N/A * has version information less than this object. 0N/A // private data members ---------------------------------------------- 0N/A * Version number stored as a byte for each of the major, minor, milli and 0N/A * micro numbers in the 32 bit int. 0N/A * Most significant for the major and the least significant contains the 0N/A * Error statement string 0N/A "Invalid version number: Version number may be negative or greater than 255";
0N/A // private constructor ----------------------------------------------- 0N/A * Constructor with int 0N/A * @param compactversion a 32 bit int with each byte representing a number 0N/A * Gets the int from the version numbers 0N/A * @param major non-negative version number 0N/A * @param minor non-negativeversion number 0N/A * @param milli non-negativeversion number 0N/A * @param micro non-negativeversion number