Package java.util

Examples of java.util.GregorianCalendar.compareTo()


            time.set(Calendar.YEAR, (time.get(Calendar.YEAR) / 1000) * 1000);
        }

        StringBuilder ticksBuilder = new StringBuilder();
        StringBuilder tickTitlesBuilder = new StringBuilder();
        while (time.compareTo(to.getGregorianCalendar()) < 0) {
            if (ticksBuilder.length() > 0) {
                ticksBuilder.append(";");
            }
            int tickPosition = TimeModel.daysBetween(from.getGregorianCalendar(), time) * width / totalDaysBetween;
            ticksBuilder.append(tickPosition);
View Full Code Here


        NodeValue v = NodeValue.makeNode("2005-02-18T20:39:10Z", XSDDatatype.XSDdateTime) ;
        assertTrue("Not a dateTime: "+v, v.isDateTime()) ;
        assertFalse("A date: "+v, v.isDate()) ;
        assertTrue("Not a node: "+v, v.hasNode()) ;
        Calendar cal2 = v.getDateTime().toGregorianCalendar() ;
        assertEquals("Not equal: "+v, 0, cal1.compareTo(cal2)) ;
    }

    @Test public void testDateTime5()
    {
        boolean b = NodeValue.VerboseWarnings ;
View Full Code Here

        NodeValue v = NodeValue.makeNode("2005-02-18Z", XSDDatatype.XSDdate) ;
        assertTrue("Not a date: "+v, v.isDate()) ;
        assertFalse("A dateTime: "+v, v.isDateTime()) ;
        assertTrue("Not a node: "+v, v.hasNode()) ;
        Calendar cal2 = v.getDateTime().toGregorianCalendar() ;
        assertEquals("Not equal: "+v, 0, cal1.compareTo(cal2)) ;
    }

    @Test public void testDate5()
    {
        boolean b = NodeValue.VerboseWarnings ;
View Full Code Here

          temp=i.getDate();
          isInList=true;
        }
      //Gregorian Calendar uses a compareTo function, returns negative number if temp is before oldest
      //compareTo returns 0 if temp equals oldest, returns positive number if temp is after oldest
      if(temp.compareTo(oldest)<0)
        oldest=temp;
    }
   
    if(isInList)
      return oldest;
View Full Code Here

     
      //starting from the first date, loop through the dates until we get to the last
      //possible expiration date of the food item: the items shelf life+the current date.
      //While we're still working before that date, and while our quantity to be removed
      //is >0, continue looping and removing, as described below:
      while((temp.compareTo(food.getExpirationDate(effective))<=0)&&quantity>0)
        {
          //If the inventory has enough of the requested fooditem, then
          //remove it, and make our removing quantity zero--then the loop
          //is exited.
          if((foodmap.get(warehouse)).getQuantity(food, temp)>=quantity)
View Full Code Here

    public void checkLocked() {
        if (this.gameProfile != null && !this.gameProfile.isEmpty()
                && ExtensionObject.DatabaseManager.isPlayerLocked(this.gameProfile)) {
            GregorianCalendar lockedDateTimeStamp = ExtensionObject.DatabaseManager.getPlayerLockedTime(this.gameProfile);

            if (lockedDateTimeStamp.compareTo(new GregorianCalendar()) <= 0) {
                ExtensionObject.DatabaseManager.removeLockedPlayer(this.gameProfile);
            } else {
                String timeDifference = GregorianCalendarHelper.GetDifferenceAsHumanReadableString(lockedDateTimeStamp,
                        new GregorianCalendar());
View Full Code Here

   * @see comum.util.grafico.Projection#getMonthProjection(java.util.Date, java.util.Date)
   */
  public List<Double> getMonthProjection(GregorianCalendar start, GregorianCalendar end) {
    GregorianCalendar currDate = CalendarUtil.cloneMonthCalendar(start)
    List<Double> values = new ArrayList<Double>();
    while(currDate.compareTo(end)<=0){
      values.add(this.getValue(currDate));
      currDate.add(GregorianCalendar.MONTH, 1);
    }
    return values;
  }
View Full Code Here

  public Map<GregorianCalendar, Double> getMapProjection(
      GregorianCalendar start, GregorianCalendar end) {
   
    GregorianCalendar currDate = CalendarUtil.cloneMonthCalendar(start)
    Map<GregorianCalendar,Double> values = new HashMap<GregorianCalendar,Double>();
    while(currDate.compareTo(end)<=0){
      values.put(CalendarUtil.cloneMonthCalendar(currDate),this.getValue(currDate));
      currDate.add(GregorianCalendar.MONTH, 1);
    }
    return values;
  }
View Full Code Here

   * @see comum.util.grafico.Projection#getMonthProjection(java.util.Date, java.util.Date)
   */
  public List<Double> getMonthProjection(GregorianCalendar start, GregorianCalendar end) {
    GregorianCalendar currDate = CalendarUtil.cloneMonthCalendar(start)
    List<Double> values = new ArrayList<Double>();
    while(currDate.compareTo(end)<=0){
      values.add(this.getValue(currDate));
      currDate.add(GregorianCalendar.MONTH, 1);
    }
    return values;
  }
View Full Code Here

      GregorianCalendar start, GregorianCalendar end) {
   
    GregorianCalendar currDate = CalendarUtil.cloneMonthCalendar(start)
    Map<GregorianCalendar,Double> values = new HashMap<GregorianCalendar,Double>();
    int iterations=0;
    while(currDate.compareTo(end)<=0){
      values.put(CalendarUtil.cloneMonthCalendar(currDate),this.getValue(currDate));
      currDate.add(GregorianCalendar.MONTH, 1);
      iterations++;
      if(iterations>ITERATION_LIMIT){
        break;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.