Package org.joda.time

Examples of org.joda.time.Partial


        if (firstExecutionYear != null) {
            ExecutionYear currentExecutionYear = ExecutionYear.readCurrentExecutionYear();
            int firstYear = firstExecutionYear.getBeginDateYearMonthDay().getYear();
            int lastYear = currentExecutionYear.getEndDateYearMonthDay().getYear();
            while (firstYear <= lastYear) {
                result.add(new Partial(DateTimeFieldType.year(), firstYear));
                firstYear++;
            }
        }

        return result;
View Full Code Here


            setMonth(Month.values()[getNumberOfMonth() - 2]);
        }
    }

    public Partial getPartial() {
        return new Partial().with(DateTimeFieldType.monthOfYear(), getNumberOfMonth()).with(DateTimeFieldType.year(), getYear());
    }
View Full Code Here

        super.setActivityInterval(interval);
    }

    public Partial getStart() {
        DateTime start = getActivityInterval().getStart();
        return new Partial().with(DateTimeFieldType.year(), start.getYear()).with(DateTimeFieldType.monthOfYear(),
                start.getMonthOfYear());
    }
View Full Code Here

        setActivityInterval(new Interval(start.toDateTime(new DateTime(0)), getActivityInterval().getEnd()));
    }

    public Partial getEnd() {
        DateTime end = getActivityInterval().getEnd();
        return new Partial().with(DateTimeFieldType.year(), end.getYear()).with(DateTimeFieldType.monthOfYear(),
                end.getMonthOfYear());
    }
View Full Code Here

  @Override
  protected Partial getValue(Line line) {
    DateTime time = (DateTime) line.getValue(WideFinderConstants.DATE);

    Partial range = JodaUtil.buildPartial(time, types);

    return range;
  }
View Full Code Here

    for (int i = 0; i < types.length; i++) {
      values[i] = time.get(types[i]);
    }

    Partial range = new Partial(types, values);
    return range;
  }
View Full Code Here

    validator = new FutureValidatorForReadablePartial();
  }

  @Test
  public void testIsValidForPartial() {
    Partial future = new Partial( new LocalDate().plusYears( 1 ) );
    Partial past = new Partial( new LocalDate().minusYears( 1 ) );

    Assert.assertTrue( validator.isValid( null, null ) );
    Assert.assertTrue( validator.isValid( future, null ) );
    Assert.assertFalse( validator.isValid( past, null ) );
  }
View Full Code Here

    validator = new PastValidatorForReadablePartial();
  }

  @Test
  public void testIsValidForPartial() {
    Partial future = new Partial( new LocalDate().plusYears( 1 ) );
    Partial past = new Partial( new LocalDate().minusYears( 1 ) );

    Assert.assertTrue( validator.isValid( null, null ) );
    Assert.assertTrue( validator.isValid( past, null ) );
    Assert.assertFalse( validator.isValid( future, null ) );
  }
View Full Code Here

TOP

Related Classes of org.joda.time.Partial

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.