MCPcopy Create free account
hub / github.com/MenoData/Time4J / createFrom

Method createFrom

base/src/main/java/net/time4j/AnnualDate.java:774–793  ·  view source on GitHub ↗
(
            TimeSource<?> clock,
            AttributeQuery attributes
        )

Source from the content-addressed store, hash-verified

772 //~ Methoden ------------------------------------------------------
773
774 @Override
775 public AnnualDate createFrom(
776 TimeSource<?> clock,
777 AttributeQuery attributes
778 ) {
779
780 Timezone zone;
781
782 if (attributes.contains(Attributes.TIMEZONE_ID)) {
783 zone = Timezone.of(attributes.get(Attributes.TIMEZONE_ID));
784 } else if (attributes.get(Attributes.LENIENCY, Leniency.SMART).isLax()) {
785 zone = Timezone.ofSystem();
786 } else {
787 return null;
788 }
789
790 PlainDate date = Moment.from(clock.currentTime()).toZonalTimestamp(zone.getID()).toDate();
791 return AnnualDate.of(date.getMonth(), date.getDayOfMonth());
792
793 }
794
795 @Override
796 public AnnualDate createFrom(

Callers

nothing calls this directly

Calls 15

ofMethod · 0.95
ofSystemMethod · 0.95
fromMethod · 0.95
getIDMethod · 0.95
ofMethod · 0.95
getMonthMethod · 0.95
getDayOfMonthMethod · 0.95
isLaxMethod · 0.80
toZonalTimestampMethod · 0.80
getMaxDayMethod · 0.80
containsMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected