test_class.declarator: TEST = "TEST"
test_class.modifier: private final
test_class.original_string: private final String TEST = "TEST";
test_class.type: String
test_class.var_name: TEST
test_class.declarator: TEST3 = "TEST3"
test_class.modifier: private final
test_class.original_string: private final String TEST3 = "TEST3";
test_class.type: String
test_class.var_name: TEST3
test_class.declarator: DEFAULT_PROPS
test_class.modifier: private static
test_class.original_string: private static Properties DEFAULT_PROPS;
test_class.type: Properties
test_class.var_name: DEFAULT_PROPS
test_class.declarator: DEFAULT
test_class.modifier: public static
test_class.original_string: public static TradingWeek DEFAULT;
test_class.type: TradingWeek
test_class.var_name: DEFAULT
test_class.file: series/src/test/java/com/barchart/feed/series/TradingWeekImplTest.java
test_class.identifier: TradingWeekImplTest
test_case.body: @Test
      public void testGetTradingSessionOnOrBefore() {
          TradingWeek tradingWeek = getTestTradingWeek(TEST);
          
          assertEquals(7, tradingWeek.length());
          
          //FIRST: Test within bounds Sunday, May 3 - Saturday, May 9
          DateTime testDate = new DateTime(2009, 5, 9, 8, 30, 0, 0);
          TradingSession session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Saturday(08:30:00.000-15:30:00.000)", session.toString());
          
          testDate = new DateTime(2009, 5, 8, 8, 30, 0, 0);
          session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Friday(08:30:00.000-15:30:00.000)", session.toString());
          
          testDate = new DateTime(2009, 5, 7, 8, 30, 0, 0);
          session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Thursday(08:30:00.000-15:30:00.000)", session.toString());
          
          testDate = new DateTime(2009, 5, 6, 8, 30, 0, 0);
          session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Wednesday(08:30:00.000-15:30:00.000)", session.toString());
          
          testDate = new DateTime(2009, 5, 5, 8, 30, 0, 0);
          session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Tuesday(08:30:00.000-15:30:00.000)", session.toString());
          
          testDate = new DateTime(2009, 5, 4, 8, 30, 0, 0);
          session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Monday(08:30:00.000-15:30:00.000)", session.toString());
          
          testDate = new DateTime(2009, 5, 3, 8, 30, 0, 0);
          session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Sunday(08:30:00.000-15:30:00.000)", session.toString());
          
          //////////////////////////////////////////////////////////
          //SECOND: Test receding to previous session
          //Receding due to days
          testDate = new DateTime(2009, 5, 10, 5, 30, 0, 0); //Sunday, May 10th
          session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Saturday(08:30:00.000-15:30:00.000)", session.toString());
          
          //Receding due to hours
          testDate = new DateTime(2009, 5, 9, 16, 30, 0, 0); //Saturday, May 9th
          session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Saturday(08:30:00.000-15:30:00.000)", session.toString());
          
          //Receding due to minutes
          testDate = new DateTime(2009, 5, 9, 15, 31, 0, 0);
          session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Saturday(08:30:00.000-15:30:00.000)", session.toString());
          
          //Receding due to seconds
          testDate = new DateTime(2009, 5, 9, 15, 30, 1, 0);
          session = tradingWeek.getTradingSessionOnOrBefore(testDate);
          assertEquals("Saturday(08:30:00.000-15:30:00.000)", session.toString());
      }
test_case.class_method_signature: TradingWeekImplTest.testGetTradingSessionOnOrBefore()
test_case.full_signature: @Test public void testGetTradingSessionOnOrBefore()
test_case.identifier: testGetTradingSessionOnOrBefore
test_case.invocations: getTestTradingWeek assertEquals length getTradingSessionOnOrBefore assertEquals toString getTradingSessionOnOrBefore assertEquals toString getTradingSessionOnOrBefore assertEquals toString getTradingSessionOnOrBefore assertEquals toString getTradingSessionOnOrBefore assertEquals toString getTradingSessionOnOrBefore assertEquals toString getTradingSessionOnOrBefore assertEquals toString getTradingSessionOnOrBefore assertEquals toString getTradingSessionOnOrBefore assertEquals toString getTradingSessionOnOrBefore assertEquals toString getTradingSessionOnOrBefore assertEquals toString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetTradingSessionOnOrBefore()
focal_class.declarator: weekMillis = -1
focal_class.modifier: private
focal_class.original_string: private long weekMillis = -1;
focal_class.type: long
focal_class.var_name: weekMillis
focal_class.declarator: sessions = new ArrayList<TradingSessionImpl>()
focal_class.modifier: private
focal_class.original_string: private List<TradingSessionImpl> sessions = new ArrayList<TradingSessionImpl>();
focal_class.type: List<TradingSessionImpl>
focal_class.var_name: sessions
focal_class.declarator: calculator
focal_class.modifier: private
focal_class.original_string: private DateCalculator<LocalDate> calculator;
focal_class.type: DateCalculator<LocalDate>
focal_class.var_name: calculator
focal_class.declarator: DEFAULT
focal_class.modifier: public static final
focal_class.original_string: public static final TradingWeek DEFAULT;
focal_class.type: TradingWeek
focal_class.var_name: DEFAULT
focal_class.declarator: DEFAULT_PROPS
focal_class.modifier: private static final
focal_class.original_string: private static final Properties DEFAULT_PROPS;
focal_class.type: Properties
focal_class.var_name: DEFAULT_PROPS
focal_class.file: series/src/main/java/com/barchart/feed/series/TradingWeekImpl.java
focal_class.identifier: TradingWeekImpl
focal_class.interfaces: implements TradingWeek
focal_class.class_method_signature: TradingWeekImpl.TradingWeekImpl(byte tradingDays)
focal_class.full_signature: private  TradingWeekImpl(byte tradingDays)
focal_class.identifier: TradingWeekImpl
focal_class.modifiers: private
focal_class.parameters: (byte tradingDays)
focal_class.signature:  TradingWeekImpl(byte tradingDays)
focal_class.class_method_signature: TradingWeekImpl.configBuilder(
          String propertiesFilePath, String calendarName, String tradingWeekName)
focal_class.full_signature: public static Builder configBuilder(
          String propertiesFilePath, String calendarName, String tradingWeekName)
focal_class.identifier: configBuilder
focal_class.modifiers: public static
focal_class.parameters: (
          String propertiesFilePath, String calendarName, String tradingWeekName)
focal_class.return: Builder
focal_class.signature: Builder configBuilder(
          String propertiesFilePath, String calendarName, String tradingWeekName)
focal_class.class_method_signature: TradingWeekImpl.configBuilder(
          Properties properties, String calendarName, String tradingWeekName)
focal_class.full_signature: public static Builder configBuilder(
          Properties properties, String calendarName, String tradingWeekName)
focal_class.identifier: configBuilder
focal_class.modifiers: public static
focal_class.parameters: (
          Properties properties, String calendarName, String tradingWeekName)
focal_class.return: Builder
focal_class.signature: Builder configBuilder(
          Properties properties, String calendarName, String tradingWeekName)
focal_class.class_method_signature: TradingWeekImpl.length()
focal_class.full_signature: @Override public int length()
focal_class.identifier: length
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int length()
focal_class.class_method_signature: TradingWeekImpl.addTradingSession(TradingSession session)
focal_class.full_signature: @Override public void addTradingSession(TradingSession session)
focal_class.identifier: addTradingSession
focal_class.modifiers: @Override public
focal_class.parameters: (TradingSession session)
focal_class.return: void
focal_class.signature: void addTradingSession(TradingSession session)
focal_class.class_method_signature: TradingWeekImpl.getStartSession()
focal_class.full_signature: @Override public TradingSession getStartSession()
focal_class.identifier: getStartSession
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: TradingSession
focal_class.signature: TradingSession getStartSession()
focal_class.class_method_signature: TradingWeekImpl.getEndSession()
focal_class.full_signature: @Override public TradingSession getEndSession()
focal_class.identifier: getEndSession
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: TradingSession
focal_class.signature: TradingSession getEndSession()
focal_class.class_method_signature: TradingWeekImpl.getTradingDaysInMonth(DateTime dt)
focal_class.full_signature: @Override public int getTradingDaysInMonth(DateTime dt)
focal_class.identifier: getTradingDaysInMonth
focal_class.modifiers: @Override public
focal_class.parameters: (DateTime dt)
focal_class.return: int
focal_class.signature: int getTradingDaysInMonth(DateTime dt)
focal_class.class_method_signature: TradingWeekImpl.isTradingDay(DateTime dt)
focal_class.full_signature: @Override public boolean isTradingDay(DateTime dt)
focal_class.identifier: isTradingDay
focal_class.modifiers: @Override public
focal_class.parameters: (DateTime dt)
focal_class.return: boolean
focal_class.signature: boolean isTradingDay(DateTime dt)
focal_class.class_method_signature: TradingWeekImpl.getSessionTradingDate(DateTime dt)
focal_class.full_signature: @Override public DateTime getSessionTradingDate(DateTime dt)
focal_class.identifier: getSessionTradingDate
focal_class.modifiers: @Override public
focal_class.parameters: (DateTime dt)
focal_class.return: DateTime
focal_class.signature: DateTime getSessionTradingDate(DateTime dt)
focal_class.class_method_signature: TradingWeekImpl.setWeekMillis()
focal_class.full_signature: private void setWeekMillis()
focal_class.identifier: setWeekMillis
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setWeekMillis()
focal_class.class_method_signature: TradingWeekImpl.getWeekMillis()
focal_class.full_signature: @Override public long getWeekMillis()
focal_class.identifier: getWeekMillis
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getWeekMillis()
focal_class.class_method_signature: TradingWeekImpl.getSessionMillisBetween(DateTime dt1, DateTime dt2)
focal_class.full_signature: @Override public long getSessionMillisBetween(DateTime dt1, DateTime dt2)
focal_class.identifier: getSessionMillisBetween
focal_class.modifiers: @Override public
focal_class.parameters: (DateTime dt1, DateTime dt2)
focal_class.return: long
focal_class.signature: long getSessionMillisBetween(DateTime dt1, DateTime dt2)
focal_class.class_method_signature: TradingWeekImpl.getTradingSessionOnOrBefore(DateTime date)
focal_class.full_signature: public TradingSession getTradingSessionOnOrBefore(DateTime date)
focal_class.identifier: getTradingSessionOnOrBefore
focal_class.modifiers: public
focal_class.parameters: (DateTime date)
focal_class.return: TradingSession
focal_class.signature: TradingSession getTradingSessionOnOrBefore(DateTime date)
focal_class.class_method_signature: TradingWeekImpl.getPreviousSessionDate(DateTime dt, Period period)
focal_class.full_signature: @Override public DateTime getPreviousSessionDate(DateTime dt, Period period)
focal_class.identifier: getPreviousSessionDate
focal_class.modifiers: @Override public
focal_class.parameters: (DateTime dt, Period period)
focal_class.return: DateTime
focal_class.signature: DateTime getPreviousSessionDate(DateTime dt, Period period)
focal_class.class_method_signature: TradingWeekImpl.getTradingSessionOnOrAfter(DateTime date)
focal_class.full_signature: @Override public TradingSession getTradingSessionOnOrAfter(DateTime date)
focal_class.identifier: getTradingSessionOnOrAfter
focal_class.modifiers: @Override public
focal_class.parameters: (DateTime date)
focal_class.return: TradingSession
focal_class.signature: TradingSession getTradingSessionOnOrAfter(DateTime date)
focal_class.class_method_signature: TradingWeekImpl.getNextSessionDate(DateTime dt, Period period)
focal_class.full_signature: @Override public DateTime getNextSessionDate(DateTime dt, Period period)
focal_class.identifier: getNextSessionDate
focal_class.modifiers: @Override public
focal_class.parameters: (DateTime dt, Period period)
focal_class.return: DateTime
focal_class.signature: DateTime getNextSessionDate(DateTime dt, Period period)
focal_class.class_method_signature: TradingWeekImpl.loadDefaultTradingWeek()
focal_class.full_signature: public static TradingWeek loadDefaultTradingWeek()
focal_class.identifier: loadDefaultTradingWeek
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: TradingWeek
focal_class.signature: TradingWeek loadDefaultTradingWeek()
focal_class.class_method_signature: TradingWeekImpl.isWorkingDay(LocalDate date)
focal_class.full_signature: @Override public boolean isWorkingDay(LocalDate date)
focal_class.identifier: isWorkingDay
focal_class.modifiers: @Override public
focal_class.parameters: (LocalDate date)
focal_class.return: boolean
focal_class.signature: boolean isWorkingDay(LocalDate date)
focal_class.class_method_signature: TradingWeekImpl.naturalDaysBetween(int startDay, int endDay)
focal_class.full_signature: public static int naturalDaysBetween(int startDay, int endDay)
focal_class.identifier: naturalDaysBetween
focal_class.modifiers: public static
focal_class.parameters: (int startDay, int endDay)
focal_class.return: int
focal_class.signature: int naturalDaysBetween(int startDay, int endDay)
focal_class.class_method_signature: TradingWeekImpl.dayToString(int day)
focal_class.full_signature: public static String dayToString(int day)
focal_class.identifier: dayToString
focal_class.modifiers: public static
focal_class.parameters: (int day)
focal_class.return: String
focal_class.signature: String dayToString(int day)
focal_class.class_method_signature: TradingWeekImpl.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: TradingWeekImpl.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_class.class_method_signature: TradingWeekImpl.equalSessions(List<TradingSessionImpl> l)
focal_class.full_signature: private boolean equalSessions(List<TradingSessionImpl> l)
focal_class.identifier: equalSessions
focal_class.modifiers: private
focal_class.parameters: (List<TradingSessionImpl> l)
focal_class.return: boolean
focal_class.signature: boolean equalSessions(List<TradingSessionImpl> l)
focal_class.class_method_signature: TradingWeekImpl.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.superclass: extends JodaWorkingWeek
focal_method.body: public TradingSession getTradingSessionOnOrBefore(DateTime date) {
          if(sessions.size() == 0) {
              throw new IllegalStateException("Trading week has no sessions configured!");
          }
          boolean decremented = false;
          while(!isWorkingDay(date.toLocalDate())) {
              date = date.minusDays(1);
              decremented = true;
          }
          int otherDay = date.getDayOfWeek();
          LocalTime lt = date.toLocalTime();
          int len = sessions.size();
          for(int i = len - 1;i >= 0;i--) {
              TradingSession ts = sessions.get(i);
              if(ts.contains(date) || decremented) {
                  return ts;
              } else if(ts.day() == otherDay) {
                 if(ts.end().isBefore(lt)) {
                     return ts;
                 }else if(ts.start().isAfter(lt)) {
                     return sessions.get(i == 0 ? len - 1 : i - 1);
                 }
              }
          }
         
          return null;
      }
focal_method.class_method_signature: TradingWeekImpl.getTradingSessionOnOrBefore(DateTime date)
focal_method.full_signature: public TradingSession getTradingSessionOnOrBefore(DateTime date)
focal_method.identifier: getTradingSessionOnOrBefore
focal_method.invocations: size isWorkingDay toLocalDate minusDays getDayOfWeek toLocalTime size get contains day isBefore end isAfter start get
focal_method.modifiers: public
focal_method.parameters: (DateTime date)
focal_method.return: TradingSession
focal_method.signature: TradingSession getTradingSessionOnOrBefore(DateTime date)