Example usage for java.util Locale US

List of usage examples for java.util Locale US

Introduction

In this page you can find the example usage for java.util Locale US.

Prototype

Locale US

To view the source code for java.util Locale US.

Click Source Link

Document

Useful constant for country.

Usage

From source file:at.uni_salzburg.cs.ckgroup.cscpp.engine.actions.Course.java

@Override
public String toString() {
    if (isComplete()) {
        return String.format(Locale.US, "Course (%d, %.1f)", getTimestamp(), courseOverGround);
    }/*from  w w w. j  a  v a2 s .  c o m*/
    return "Course";
}

From source file:com.QuarkLabs.BTCeClient.loaders.OrderBookLoader.java

@Override
public JSONObject loadInBackground() {
    String urlString = "https://btc-e.com/api/2/" + mPair.toLowerCase(Locale.US).replace("/", "_") + "/depth";
    String out = "";
    try {/* www  .  j  a v a  2s.c  om*/
        URL url = new URL(urlString);
        URLConnection connection = url.openConnection();
        InputStream stream = connection.getInputStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
        String line;
        while ((line = reader.readLine()) != null) {
            out += line;
        }
        mData = new JSONObject(out);
        stream.close();
        reader.close();
    } catch (IOException | JSONException e) {
        e.printStackTrace();
    }
    return mData;
}

From source file:name.gumartinm.weather.information.service.ServiceForecastParser.java

public String createURIAPIForecast(final String urlAPI, final String APIVersion, final double latitude,
        final double longitude, final String resultsNumber) {

    final MessageFormat formatURIAPI = new MessageFormat(urlAPI, Locale.US);
    final Object[] values = new Object[4];
    values[0] = APIVersion;/*from   w  w w .  j  av a2  s .  c  o  m*/
    values[1] = latitude;
    values[2] = longitude;
    values[3] = resultsNumber;

    return formatURIAPI.format(values);
}

From source file:at.uni_salzburg.cs.ckgroup.cscpp.engine.actions.Temperature.java

@Override
public String toString() {
    if (isComplete()) {
        return String.format(Locale.US, "Temperature (%d, %.1f)", getTimestamp(), temperature);
    }/*from w w w. j  a va2s  .  co  m*/
    return "Temperature";
}

From source file:at.uni_salzburg.cs.ckgroup.cscpp.engine.actions.AirPressure.java

@Override
public String toString() {
    if (isComplete()) {
        return String.format(Locale.US, "AirPressure (%d, %.1f)", getTimestamp(), airPressure);
    }/*from w w  w  .j  a v a 2 s  . co  m*/
    return "AirPressure";
}

From source file:thymeleafsandbox.springjsp.web.conversion.NumberFormatter.java

public Number parse(final String text, final Locale locale) throws ParseException {
    final DecimalFormat numberFormat = (DecimalFormat) NumberFormat.getNumberInstance();
    final DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US);
    symbols.setGroupingSeparator('*');
    numberFormat.setDecimalFormatSymbols(symbols);
    return numberFormat.parse(text);
}

From source file:com.nttec.everychan.ui.tabs.LocalHandler.java

public static TabModel getTabModel(String filename, Resources resources) {
    File file = new File(filename);
    if (file.exists() && !file.isDirectory()) {
        String lfilename = filename.toLowerCase(Locale.US);
        if (!lfilename.endsWith(".zip") && !lfilename.endsWith(".mht") && !lfilename.endsWith(".mhtml")) {
            file = file.getParentFile();
            filename = file.getAbsolutePath();
        }/*w  w w. ja  v a  2s.c  o  m*/
    }

    ReadableContainer zip = null;
    UrlPageModel pageModel;
    String pageTitle;
    try {
        zip = ReadableContainer.obtain(file);
        Pair<String, UrlPageModel> p = MainApplication.getInstance().serializer
                .loadPageInfo(zip.openStream(DownloadingService.MAIN_OBJECT_FILE));
        pageTitle = p.getLeft();
        pageModel = p.getRight();
    } catch (Exception e) {
        Logger.e(TAG, e);
        MainApplication.getInstance().database.removeSavedThread(filename);
        return null;
    } finally {
        try {
            if (zip != null)
                zip.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    TabModel model = new TabModel();
    model.type = TabModel.TYPE_LOCAL;
    model.id = new Random().nextLong();
    model.title = pageTitle;
    model.pageModel = pageModel;
    model.hash = CryptoUtils.computeMD5(filename);
    try {
        model.webUrl = MainApplication.getInstance().getChanModule(pageModel.chanName).buildUrl(pageModel);
    } catch (IllegalArgumentException e) {
        model.webUrl = null;
    } catch (NullPointerException e) {
        return null;
    }
    model.localFilePath = filename;
    model.forceUpdate = true;
    return model;
}

From source file:at.uni_salzburg.cs.ckgroup.cscpp.engine.actions.Altitude.java

@Override
public String toString() {
    if (isComplete()) {
        return String.format(Locale.US, "Altitude (%d, %.1f)", getTimestamp(), altitudeOverGround);
    }/*from w w w .  j  a  v a  2  s . c  o  m*/
    return "Altitude";
}

From source file:com.telenav.amazon.s3.tvmclient.AmazonTVMClient.java

public AmazonTVMClient(SharedPreferences sharedPreferences, String endpoint, boolean useSSL) {
    this.endpoint = this.getEndpointDomainName(endpoint.toLowerCase(Locale.US));
    this.useSSL = useSSL;
    this.sharedPreferences = sharedPreferences;
}

From source file:Main.java

/**
 * Get a fragment in a {@link ViewPager}s adapter.
 *
 * @param manager/*from w w w .j a v  a  2s  . c  om*/
 *     the support fragment manager {@link android.app.Activity#getFragmentManager()}
 * @param pager
 *     the {@link ViewPager} holding the {@link android.app.Fragment}
 * @param position
 *     the position in the {@link ViewPager} e.g. {@link ViewPager#getCurrentItem()}
 * @param <fragment>
 *     Destination cast class type.
 * @return the fragment at this position in the {@link ViewPager}'s adapter
 */
@SuppressWarnings("unchecked")
public static <fragment extends android.app.Fragment> fragment findFragmentByPosition(
        android.app.FragmentManager manager, ViewPager pager, int position) {
    return (fragment) manager
            .findFragmentByTag(String.format(Locale.US, FRAGMENT_ADAPTER_ID, pager.getId(), position));
}