< prev index next >

test/hotspot/jtreg/runtime/valhalla/valuetypes/ValueTypeDensity.java

Print this page




  59         public int getYear();
  60         public short getMonth();
  61         public short getDay();
  62     }
  63 
  64     interface LocalTime {
  65         public byte getHour();
  66         public byte getMinute();
  67         public byte getSecond();
  68         public int getNano();
  69     }
  70 
  71     interface LocalDateTime extends LocalDate, LocalTime {}
  72 
  73     static final __ByValue class LocalDateValue implements LocalDate {
  74         final int   year;
  75         final short month;
  76         final short day;
  77 
  78         LocalDateValue() {
  79             this.year  = 0;
  80             this.month = 0;
  81             this.day   = 0;
  82         }
  83 
  84         public int   getYear()  { return year; }
  85         public short getMonth() { return month; }
  86         public short getDay()   { return day; }
  87 
  88         __ValueFactory public static LocalDateValue create(int year, short month, short day) {
  89             LocalDateValue localDate = __MakeDefault LocalDateValue();
  90             localDate.year  = year;
  91             localDate.month = month;
  92             localDate.day   = day;
  93             return localDate;
  94         }
  95     }
  96 
  97     static final __ByValue class LocalTimeValue implements LocalTime {
  98         final byte hour;
  99         final byte minute;
 100         final byte second;
 101         final int nano;
 102 
 103         LocalTimeValue() {
 104             this.hour   = 0;
 105             this.minute = 0;
 106             this.second = 0;
 107             this.nano   = 0;
 108         }
 109 
 110         public byte getHour()   { return hour; }
 111         public byte getMinute() { return minute; }
 112         public byte getSecond() { return second; }
 113         public int getNano()    { return nano; }
 114 
 115         __ValueFactory public static LocalTimeValue create(byte hour, byte minute, byte second, int nano) {
 116             LocalTimeValue localTime = __MakeDefault LocalTimeValue();
 117             localTime.hour   = hour;
 118             localTime.minute = minute;
 119             localTime.second = second;
 120             localTime.nano   = nano;
 121             return localTime;
 122         }
 123     }
 124 
 125     static final __ByValue class LocalDateTimeValue implements LocalDateTime {
 126         final LocalDateValue date;
 127         final LocalTimeValue time;
 128 
 129         LocalDateTimeValue() {
 130             // Well this is a little weird...
 131             date = LocalDateValue.create(0, (short)0, (short)0);
 132             time = LocalTimeValue.create((byte)0, (byte)0, (byte)0, 0);
 133         }
 134 
 135         public int   getYear()  { return date.year; }
 136         public short getMonth() { return date.month; }
 137         public short getDay()   { return date.day; }
 138 
 139         public byte getHour()   { return time.hour; }
 140         public byte getMinute() { return time.minute; }
 141         public byte getSecond() { return time.second; }
 142         public int getNano()    { return time.nano; }
 143 
 144         __ValueFactory public static LocalDateTimeValue create(LocalDateValue date, LocalTimeValue time) {
 145             LocalDateTimeValue localDateTime = __MakeDefault LocalDateTimeValue();
 146             localDateTime.date = date;
 147             localDateTime.time = time;
 148             return localDateTime;
 149         }
 150     }
 151 
 152     static final class LocalDateClass implements LocalDate {
 153         final int   year;
 154         final short month;
 155         final short day;
 156 
 157         LocalDateClass(int year, short month, short day) {
 158             this.year  = year;
 159             this.month = month;
 160             this.day   = day;
 161         }
 162 
 163         public int   getYear()  { return year; }
 164         public short getMonth() { return month; }




  59         public int getYear();
  60         public short getMonth();
  61         public short getDay();
  62     }
  63 
  64     interface LocalTime {
  65         public byte getHour();
  66         public byte getMinute();
  67         public byte getSecond();
  68         public int getNano();
  69     }
  70 
  71     interface LocalDateTime extends LocalDate, LocalTime {}
  72 
  73     static final __ByValue class LocalDateValue implements LocalDate {
  74         final int   year;
  75         final short month;
  76         final short day;
  77 
  78         LocalDateValue() {
  79             year  = 0;
  80             month = 0;
  81             day   = 0;
  82         }
  83 
  84         public int   getYear()  { return year; }
  85         public short getMonth() { return month; }
  86         public short getDay()   { return day; }
  87 
  88         public static LocalDateValue create(int year, short month, short day) {
  89             LocalDateValue localDate = __MakeDefault LocalDateValue();
  90             localDate.year  = year;
  91             localDate.month = month;
  92             localDate.day   = day;
  93             return localDate;
  94         }
  95     }
  96 
  97     static final __ByValue class LocalTimeValue implements LocalTime {
  98         final byte hour;
  99         final byte minute;
 100         final byte second;
 101         final int nano;
 102 
 103         LocalTimeValue() {
 104             hour   = 0;
 105             minute = 0;
 106             second = 0;
 107             nano   = 0;
 108         }
 109 
 110         public byte getHour()   { return hour; }
 111         public byte getMinute() { return minute; }
 112         public byte getSecond() { return second; }
 113         public int getNano()    { return nano; }
 114 
 115         public static LocalTimeValue create(byte hour, byte minute, byte second, int nano) {
 116             LocalTimeValue localTime = __MakeDefault LocalTimeValue();
 117             localTime.hour   = hour;
 118             localTime.minute = minute;
 119             localTime.second = second;
 120             localTime.nano   = nano;
 121             return localTime;
 122         }
 123     }
 124 
 125     static final __ByValue class LocalDateTimeValue implements LocalDateTime {
 126         final LocalDateValue date;
 127         final LocalTimeValue time;
 128 
 129         LocalDateTimeValue() {
 130             // Well this is a little weird...
 131             date = LocalDateValue.create(0, (short)0, (short)0);
 132             time = LocalTimeValue.create((byte)0, (byte)0, (byte)0, 0);
 133         }
 134 
 135         public int   getYear()  { return date.year; }
 136         public short getMonth() { return date.month; }
 137         public short getDay()   { return date.day; }
 138 
 139         public byte getHour()   { return time.hour; }
 140         public byte getMinute() { return time.minute; }
 141         public byte getSecond() { return time.second; }
 142         public int getNano()    { return time.nano; }
 143 
 144         public static LocalDateTimeValue create(LocalDateValue date, LocalTimeValue time) {
 145             LocalDateTimeValue localDateTime = __MakeDefault LocalDateTimeValue();
 146             localDateTime.date = date;
 147             localDateTime.time = time;
 148             return localDateTime;
 149         }
 150     }
 151 
 152     static final class LocalDateClass implements LocalDate {
 153         final int   year;
 154         final short month;
 155         final short day;
 156 
 157         LocalDateClass(int year, short month, short day) {
 158             this.year  = year;
 159             this.month = month;
 160             this.day   = day;
 161         }
 162 
 163         public int   getYear()  { return year; }
 164         public short getMonth() { return month; }


< prev index next >