// Copyright 2001-2004, Danger, Inc. All Rights Reserved.
// This file is subject to the Danger, Inc. Sample Code License,
// which is provided in the file SAMPLE_CODE_LICENSE.
// Copies are also available from http://developer.danger.com/

package com.example.DataStoreDemo;

import danger.internal.Date;
import danger.util.StringUtils;

/**
 * This class encapsulates the version specific code necessary for maintaining
 * the 1.1 and 2.0 versions of the application.
 * 
 * These are utility routines, that perform the version specific tasks. The
 * routines are marked static so that they can be called without needing
 * instantiation.
 * 
 * This file is for the 1.1 variant of the code.
 */
public class Version {

	/**
	 * Compare the two strings passed in, in the best way possible for the
	 * version of the OS.
	 * 
	 * The StringUtils version here does not support diacritical marks. 
	 * 
	 * Return less than 0, equal to 0, or greater than 0.
	 */
	public static int compareStrings(String name0, String name1) {
		return (StringUtils.compareNaturalOrderIgnoreCase(name0, name1));
	}

	/**
	 * Return the short style Date string for the passed in Date.
	 * 
	 * This version does not change format with the locale.
	 */
	public static String getDateString(Date date) {
		return (date.getShortDateString());
	}

}
