- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.facebook.device.yearclass.YearClass.getRamYear()
方法的一些代码示例,展示了YearClass.getRamYear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearClass.getRamYear()
方法的具体详情如下:
包路径:com.facebook.device.yearclass.YearClass
类名称:YearClass
方法名:getRamYear
[英]Calculates the year class by the amount of RAM the phone has. Evaluations are based off the table below: AmountYear>2GB2014201320122011201020092008
[中]根据手机的内存量计算年份。评估基于下表:金额年>2GB20142014201320122011201020092008
代码示例来源:origin: facebook/device-year-class
/**
* Calculates the "best-in-class year" of the device. This represents the top-end or flagship
* devices of that year, not the actual release year of the phone. For example, the Galaxy Duos
* S was released in 2012, but its specs are very similar to the Galaxy S that was released in
* 2010 as a then top-of-the-line phone, so it is a 2010 device.
*
* @return The year when this device would have been considered top-of-the-line.
*/
private static int categorizeByYear2014Method(Context c) {
ArrayList<Integer> componentYears = new ArrayList<Integer>();
conditionallyAdd(componentYears, getNumCoresYear());
conditionallyAdd(componentYears, getClockSpeedYear());
conditionallyAdd(componentYears, getRamYear(c));
if (componentYears.isEmpty())
return CLASS_UNKNOWN;
Collections.sort(componentYears);
if ((componentYears.size() & 0x01) == 1) { // Odd number; pluck the median.
return componentYears.get(componentYears.size() / 2);
} else { // Even number. Average the two "center" values.
int baseIndex = componentYears.size() / 2 - 1;
// There's an implicit rounding down in here; 2011.5 becomes 2011.
return componentYears.get(baseIndex) +
(componentYears.get(baseIndex + 1) - componentYears.get(baseIndex)) / 2;
}
}
代码示例来源:origin: com.facebook.device.yearclass/yearclass
/**
* Calculates the "best-in-class year" of the device. This represents the top-end or flagship
* devices of that year, not the actual release year of the phone. For example, the Galaxy Duos
* S was released in 2012, but its specs are very similar to the Galaxy S that was released in
* 2010 as a then top-of-the-line phone, so it is a 2010 device.
*
* @return The year when this device would have been considered top-of-the-line.
*/
private static int categorizeByYear2014Method(Context c) {
ArrayList<Integer> componentYears = new ArrayList<Integer>();
conditionallyAdd(componentYears, getNumCoresYear());
conditionallyAdd(componentYears, getClockSpeedYear());
conditionallyAdd(componentYears, getRamYear(c));
if (componentYears.isEmpty())
return CLASS_UNKNOWN;
Collections.sort(componentYears);
if ((componentYears.size() & 0x01) == 1) { // Odd number; pluck the median.
return componentYears.get(componentYears.size() / 2);
} else { // Even number. Average the two "center" values.
int baseIndex = componentYears.size() / 2 - 1;
// There's an implicit rounding down in here; 2011.5 becomes 2011.
return componentYears.get(baseIndex) +
(componentYears.get(baseIndex + 1) - componentYears.get(baseIndex)) / 2;
}
}
本文整理了Java中com.facebook.device.yearclass.YearClass.getClockSpeedYear()方法的一些代码示例,展示了YearClass.getClock
本文整理了Java中com.facebook.device.yearclass.YearClass.categorizeByYear2016Method()方法的一些代码示例,展示了YearClass
本文整理了Java中com.facebook.device.yearclass.YearClass.categorizeByYear2014Method()方法的一些代码示例,展示了YearClass
本文整理了Java中com.facebook.device.yearclass.YearClass.get()方法的一些代码示例,展示了YearClass.get()的具体用法。这些代码示例主要来源于
本文整理了Java中com.facebook.device.yearclass.YearClass.getRamYear()方法的一些代码示例,展示了YearClass.getRamYear()的具体
本文整理了Java中com.facebook.device.yearclass.YearClass类的一些代码示例,展示了YearClass类的具体用法。这些代码示例主要来源于Github/Stack
我探索了 Facebook 开源 device-year-class并发现了一些我想问的有趣问题。 这是一个非常简单的类,可以进行一些计算并返回您设备的年份 public class YearClas
我是一名优秀的程序员,十分优秀!