List of usage examples for java.lang Long valueOf
@HotSpotIntrinsicCandidate public static Long valueOf(long l)
From source file:Main.java
public static String timesOne(String time) { SimpleDateFormat sdr = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); @SuppressWarnings("unused") long lcc = Long.valueOf(time); int i = Integer.parseInt(time); String times = sdr.format(new Date(i * 1000L)); return times; }
From source file:Main.java
public static String buildIdentificationNumberWithDecimalSeparator(CharSequence number) { if (number.length() == 0) { return number.toString(); }/*from w w w . j a v a 2s . c o m*/ try { Long value = Long.valueOf(number.toString()); Locale.setDefault(Locale.GERMAN); return String.format("%,d", value); } catch (NumberFormatException e) { return ""; } }
From source file:Main.java
public static Bitmap getVedioThubnailPath(String id, Context context) { long vedioId = Long.valueOf(id); BitmapFactory.Options option = new BitmapFactory.Options(); return Thumbnails.getThumbnail(context.getContentResolver(), vedioId, Thumbnails.MINI_KIND, option); }
From source file:Main.java
public static String formatSize(Context context, String size) { return Formatter.formatFileSize(context, Long.valueOf(TextUtils.isEmpty(size) ? "0" : size)); }
From source file:Main.java
public static String timeStampToDate(String time, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); Timestamp ts = new Timestamp(Long.valueOf(time) * 1000); String date = sdf.format(ts); return date;//from ww w . j av a 2s . c o m }
From source file:Main.java
public static ArrayList<Long> asLongList(String[] stringArray) { ArrayList<Long> result = new ArrayList<Long>(); if (stringArray != null) { for (String string : stringArray) { result.add(Long.valueOf(string)); }// ww w.java 2 s. co m } return result; }
From source file:Main.java
public static long obdVersionStringToLong(String obdVerison) { if ("".equals(obdVerison)) return 0; if (obdVerison.endsWith("S")) obdVerison = obdVerison.substring(0, obdVerison.length() - 1); String[] obdVersionArray = obdVerison.split("\\."); return Long.valueOf(obdVersionArray[0] + obdVersionArray[1] + obdVersionArray[2]); }
From source file:Main.java
public static void keep_setLong(Field field, Object obj, Cursor cursor, int i) { try {//from ww w . j a va 2 s. c o m if (field.getType().equals(Long.TYPE)) field.setLong(obj, cursor.getLong(i)); else field.set(obj, Long.valueOf(cursor.getLong(i))); } catch (Exception exception) { exception.printStackTrace(); } }
From source file:Main.java
private static Uri getInstancesUri(final String getDataMilliSeconds) { final Uri.Builder builder = Instances.CONTENT_URI.buildUpon(); // StartDate//w ww. j a v a 2 s .co m ContentUris.appendId(builder, Long.valueOf(getDataMilliSeconds)); // EndDate ContentUris.appendId(builder, Long.valueOf(getDataMilliSeconds)); return builder.build(); }
From source file:Main.java
public static String getStrTime_y(String cc_time) { String re_StrTime = null;/*from w w w. ja v a 2 s.c o m*/ SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); long lcc_time = Long.valueOf(cc_time); re_StrTime = sdf.format(new Date(lcc_time * 1000L)); return re_StrTime; }