2021-03-16

Java学习(8)

第八章 实用类

8.1 枚举

枚举(Enum)是一种有确定取值区间的数据类型。

语法:

public enum 枚举名{

值1,值2…

}

8.2 Math

详见classmath.java

8.3 Random
方法描述
public Random()创建一个无参的随机数构造器,使用系统时间(ms)作为默认种子
public Random(long seed)使用long数据类型的种子创建一个随机数构造器
public boolean nextBoolean()返回一个伪随机数,它取自此随机数生成器序列的均匀分布的boolean值
public double nextDouble()返回下一个伪随机数,它取自此随机数生产器序列的,在1.0和1.0之间均匀分布的double值
public float nextFloat()返回下一个伪随机数,它取自此随机数生产器序列的,在1.0和1.0之间均匀分布的float值
public int nextInt()返回下一个伪随机数,它取自此随机数生产器序中均匀分布的int值
publid long nextLong()返回下一个伪随机数,它取自此随机数生产器序中均匀分布的long值
public synchronized void setSeed(long seed)使用单个long种子设置此随机数生成器的种子
8.4 String
方法描述
public String()创建一个值为空的对象
public String(String original)创建一个值为original的对象
public String(char value[])将一个char型数组转为字符串对象
public String(char value[], int offest,int count)将一个指定范围的char型数组转为字符串对象
public String(byte[] bytes)将一个byte型数组转为字符串对象
public String(byte bytes[],int offset,int length)将一个指定范围的byte型数组转为字符串对象
public int length()返回字符串的长度
public boolean isEmpty()判断字符串是否为空
public byte[] getBytes()将字符串转为byte型数组
public boolean equals(0bject anObject)判断两个字符串是否相等
public boolean equalslgnoreCase(String anotherString)判断两个字符串是否相等并且忽略大小写
public int compareTo(String anotherString)对两个字符串进行排序
pulic boolean startsWith(String prefix)判断是否指定的值开头
pulic boolean endsWith(String suffix)判断是否以指定的值结尾
public int hashCode()获取字符串的散列值
public int intdexOf(String str)从头开始查找指定字符的位置
public int intdexOf(Stering str, int fromlndex)从指定的位置开始查找指定字符的位置
public String substring(int beginlndex)截取字符串从指定位置开始到结尾
public String substring(int beginlndex,int endlndex)截取字符串从指定位置开始到指定位置结束
public String concat(String str)追加字符串
public String replaceAll(String regex,String replacement)替换字符串
public String[] split(String regex)用指定字符串对目标字符串进行分割,返回数组
public String toLowerCase()将字符串转为小写
public String toUpperCase()将字符串转为大写
public char[] toCharArray()将字符串转为char型数组
public char charAt(int index)获取指定索引位置的字符串
8.5 StringBuffer
方法描述
public StringBuffer()无参构造,创建一个空的StringBuffer
public StringBuffer(String str)有参构造
public synchronized int length()返回StringBuffer的长度
public synchronized char charAt(int index)返回字符串中指定位置的字符
public synchronized StringBuffer append(String str)追加字符
public synchronized StringBuffer delete(int start, int end)删除指定区间内的字符
public synchronized StringBuffer deleteCharAt(int index)删除指定位置的字符
public synchronized StringBuffer replace(int start, int end, String str)将指定区间内的值替换为str
public synchronized String substring(int start)截取字符串从指定位置开始到结尾
public synchronized String substring(int start, int end)截取字符串从指定位置开始到指定位置结束
public synchronized StringBuffer insert(int offset, String str)向指定位置插入str
public int indexOf(String str)从头开始查找指定字符的位置
public int indexOf(String str, int fromindex)从指定的位置开始查找指定字符的位置
public synchronized StringBuffer reverse()进行反转
public synchronized String toString()返回StringBuffer对应的String
8.6 Date & Calendar

SimpleDateFormat的模版标记:

标记描述
y年,yyyy表示4位数的年份信息
M月,MM表示2位数的月份信息
m分钟,mm表示2位数的分钟信息
d天,dd表示2位数的天信息
H小时,HH表示2位数的24小时制下的小时信息
h小时,hh表示2位数的12小时制下的小时信息
s秒,ss表示2位数的秒信息
S毫秒,SSS表示3位数的毫秒信息

Calendar类描述

常量描述
public static final int YEAR
public static final int MONTH
public static final int DAY_OF_MONTH天,以月为单位,即当天是该月中的第几天
public static final int DAY_OF_YEAR天,以年为单位,即当天是该年中的第几天
public static final int HOUR_OF_DAY小时
public static final int MINUTE分钟
public static final int SECOND
public static final int MILLISECOND毫秒

Calendar常用方法

方法描述
public static Calendar getlnstance()获取系统对应的Ccalendar实例化对象
public void set(int field, int value)给静态常量赋值
public int get (int field)取出静态常量
public final Date getTime()获取Calendar对应的Date对象
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
2021-03-26 20:54:33,596 - Model - INFO - Epoch 1 (1/200): 2021-03-26 20:57:40,380 - Model - INFO - Train Instance Accuracy: 0.571037 2021-03-26 20:58:16,623 - Model - INFO - Test Instance Accuracy: 0.718528, Class Accuracy: 0.627357 2021-03-26 20:58:16,623 - Model - INFO - Best Instance Accuracy: 0.718528, Class Accuracy: 0.627357 2021-03-26 20:58:16,623 - Model - INFO - Save model... 2021-03-26 20:58:16,623 - Model - INFO - Saving at log/classification/pointnet2_msg_normals/checkpoints/best_model.pth 2021-03-26 20:58:16,698 - Model - INFO - Epoch 2 (2/200): 2021-03-26 21:01:26,685 - Model - INFO - Train Instance Accuracy: 0.727947 2021-03-26 21:02:03,642 - Model - INFO - Test Instance Accuracy: 0.790858, Class Accuracy: 0.702316 2021-03-26 21:02:03,642 - Model - INFO - Best Instance Accuracy: 0.790858, Class Accuracy: 0.702316 2021-03-26 21:02:03,642 - Model - INFO - Save model... 2021-03-26 21:02:03,643 - Model - INFO - Saving at log/classification/pointnet2_msg_normals/checkpoints/best_model.pth 2021-03-26 21:02:03,746 - Model - INFO - Epoch 3 (3/200): 2021-03-26 21:05:15,349 - Model - INFO - Train Instance Accuracy: 0.781606 2021-03-26 21:05:51,538 - Model - INFO - Test Instance Accuracy: 0.803641, Class Accuracy: 0.738575 2021-03-26 21:05:51,538 - Model - INFO - Best Instance Accuracy: 0.803641, Class Accuracy: 0.738575 2021-03-26 21:05:51,539 - Model - INFO - Save model... 2021-03-26 21:05:51,539 - Model - INFO - Saving at log/classification/pointnet2_msg_normals/checkpoints/best_model.pth 我有类似于这样的一段txt文件,请你帮我写一段代码来可视化这些训练结果
最新发布
02-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

HLY虎狼鹰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值