Definition at line 203 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.DateExtractUnit |
( |
String |
token, |
|
|
Function< LocalDateTime, Long > |
f |
|
) |
| |
|
inlineprivate |
Definition at line 334 of file DateTimeTest.java.
References f().
335 this.sqlToken = token;
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)
com.mapd.tests.DateTimeTest.DateExtractUnit.daDAY |
Initial value:
@Override
public Long apply(LocalDateTime t) {
return (long) t.get(ChronoField.DAY_OF_MONTH);
}
})
Definition at line 240 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daDAYOFYEAR |
Initial value:
@Override
public Long apply(LocalDateTime t) {
return (long) t.get(ChronoField.DAY_OF_YEAR);
}
})
Definition at line 324 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daHOUR |
Initial value:
@Override
public Long apply(LocalDateTime t) {
return (long) t.get(ChronoField.HOUR_OF_DAY);
}
})
Definition at line 246 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daMICROSECOND |
Initial value:
@Override
public Long apply(LocalDateTime t) {
return t.get(ChronoField.MICRO_OF_SECOND)
+ (1000_000L * t.get(ChronoField.SECOND_OF_MINUTE));
}
})
Definition at line 274 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daMILLISECOND |
Initial value:
@Override
public Long apply(LocalDateTime t) {
return t.get(ChronoField.MILLI_OF_SECOND)
+ (1000L * t.get(ChronoField.SECOND_OF_MINUTE));
}
})
Definition at line 267 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daMINUTE |
Initial value:
@Override
public Long apply(LocalDateTime t) {
return (long) t.get(ChronoField.MINUTE_OF_HOUR);
}
})
Definition at line 252 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daMONTH |
Initial value:
@Override
public Long apply(LocalDateTime t) {
return (long) t.get(ChronoField.MONTH_OF_YEAR);
}
})
Definition at line 234 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daNANOSECOND |
Initial value:
@Override
public Long apply(LocalDateTime t) {
return t.get(ChronoField.NANO_OF_SECOND)
+ (1000_000_000L * t.get(ChronoField.SECOND_OF_MINUTE));
}
})
Definition at line 281 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daQUARTER |
Initial value:
@Override
public Long apply(LocalDateTime t) {
int month = t.get(ChronoField.MONTH_OF_YEAR);
switch (month) {
case 1:
case 2:
case 3:
return 1l;
case 4:
case 5:
case 6:
return 2l;
case 7:
case 8:
case 9:
return 3l;
case 10:
case 11:
case 12:
return 4l;
}
return -1l;
}
})
Definition at line 209 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daSECOND |
Initial value:
@Override
public Long apply(LocalDateTime t) {
return (long) t.get(ChronoField.SECOND_OF_MINUTE);
}
})
Definition at line 258 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daWEEK |
Initial value:
@Override
public Long apply(LocalDateTime t) {
LocalDateTime year = DateTruncUnit.dtYEAR.trunc.apply(t);
year = year.plusDays(3);
LocalDateTime week = DateTruncUnit.dtWEEK.trunc.apply(year);
if (week.compareTo(t) > 0) {
year = year.minusYears(1);
week = DateTruncUnit.dtWEEK.trunc.apply(year);
}
int weeks = 0;
while (week.compareTo(t) <= 0) {
weeks++;
week = week.plusWeeks(1);
}
return (long) weeks;
}
})
Definition at line 288 of file DateTimeTest.java.
com.mapd.tests.DateTimeTest.DateExtractUnit.daYEAR |
Initial value:
public Long apply(LocalDateTime t) {
return (long) t.get(ChronoField.YEAR);
}
})
Definition at line 204 of file DateTimeTest.java.
Function<LocalDateTime, Long> com.mapd.tests.DateTimeTest.DateExtractUnit.extract |
|
private |
String com.mapd.tests.DateTimeTest.DateExtractUnit.sqlToken |
|
private |
The documentation for this enum was generated from the following file:
- /home/jenkins-slave/workspace/core-os-doxygen/java/utility/src/main/java/com/mapd/tests/DateTimeTest.java