FieldPosition
构造器
其他构造器涉及到Format.Field,先放着
方法
equals()也是重写过,只要int field相同就返回true,不需要是用一个对象
getBeginIndex() 不知道怎么用
getEndIndex() 和上面一样
getField() 同样不理解
==getFieldAttribute() ==
hashCode()
setBeginIndex()
setEndIndex()
toString()
import java.text.*;
import java.util.*;
import java.time.*;
import static java.text.MessageFormat.*;
import static java.text.AttributedCharacterIterator.*;
public class Test
{
public static void main(String[] args) throws Exception,Throwable
{
//FieldPosition
FieldPosition fp1 = new FieldPosition(0);
FieldPosition fp2 = new FieldPosition(0);
System.out.println(fp1.equals(fp1));
System.out.println(fp1.equals(fp2));
System.out.println(fp1.getBeginIndex());
System.out.println(fp2.getBeginIndex());
System.out.println(fp1.getEndIndex());
System.out.println(fp1.getField());
System.out.println(fp1.getFieldAttribute());
System.out.println(fp1.hashCode());
FieldPosition fp3 = new FieldPosition(4);
System.out.println(fp3.hashCode());
System.out.println(fp1.getBeginIndex());
fp1.setBeginIndex(10);
System.out.println(fp1.getBeginIndex());
System.out.println(fp1.getEndIndex());
fp1.setEndIndex(10);
System.out.println(fp1.getEndIndex());
System.out.println(fp1.toString());
}
}