Package java.util

Examples of java.util.HashSet$MyIterator


  @return true iff the date is part of the meta set
  ***/
  private boolean isDateInMetaSet(Calendar curProtoDate , int unit , HashSet metaSet)
  {
    Integer cur = new Integer( curProtoDate.get(unit) );
    HashSet locallyValidSet = (HashSet)metaSet.clone();

    int localMax = curProtoDate.getActualMaximum(unit);
    int modVal;

    for ( Iterator it = locallyValidSet.iterator() ; it.hasNext() ; ){
      modVal = ((Integer)it.next()).intValue();
      if ( modVal<0 ){
        //-1 implies the last item in the group, so the +1 makes it all work out.
        locallyValidSet.add( new Integer( modVal+localMax+1 ) );
      }
    }

    if ( !locallyValidSet.contains(cur) ){
      return false;
    }

    return true;
  }
View Full Code Here


  {
    if ( metaSet==null || metaSet.size()==0 ) {
      return origSet;
    }

    HashSet result = new HashSet();

    for ( Iterator oit = origSet.iterator() ; oit.hasNext() ; ){
      Calendar curProtoDate = (Calendar)oit.next();

      int localMax = curProtoDate.getActualMaximum(unit);
      int modVal;

      for ( Iterator it = metaSet.iterator() ; it.hasNext() ; ){
        modVal = ((Integer)it.next()).intValue();
        if ( modVal<0 ){
          //-1 implies the last item in the group, so the +1 makes it all work out.
          modVal = modVal+localMax+1;
        }
        Calendar newDate = (Calendar)curProtoDate.clone();
        newDate.set(unit,modVal);
        result.add(newDate);
      }
    }

    return result;
  }
View Full Code Here

    if ( "YEARLY".equals(freq) ){
      unit = Calendar.YEAR;
    }
    println("in bwdms: unit = "+unit);

    HashSet result = new HashSet();

    for ( Iterator oit = origSet.iterator() ; oit.hasNext() ; ){
      Calendar curProtoDate = (Calendar)oit.next();

      for ( Iterator it = metaSet.iterator() ; it.hasNext() ; ){
        ByDay bd  = (ByDay)it.next();

        if ( bd.count==0 ){
          println("in bwdms: finding all");
          // they want all occurrences
          ByDay localbd = new ByDay(1,bd.weekday);


          Calendar str = Calendar.getInstance();
          str.setTime(start);
          Calendar hunter = huntDayOfWeek( str , localbd);

          // some of the other BYxyz commands may limit the scope of this breeding.
          // figure that out here
          int localUnit = unit;
          boolean needSameMonth = false;
          boolean needSameWeek = false;
          boolean needSameDay = false;
          if ( foundByMonth || "MONTHLY".equals(freq) ) needSameMonth = true;
          //if ( foundByMonthDay || foundByWeekNo || foundByYearDay || "WEEKLY".equals(freq) ) needSameWeek = true;
          if ( foundByWeekNo || "WEEKLY".equals(freq) ) needSameWeek = true;
          if ( foundByMonthDay || foundByYearDay || "DAILY".equals(freq) ) needSameDay = true;

          println("nsm "+needSameMonth);
          println("nsw "+needSameWeek);
          println("nsd "+needSameDay);

          while ( hunter.getTime().before(end) ){               //JJHNOTE
            if ( hunter.get(Calendar.YEAR) == curProtoDate.get(Calendar.YEAR) ){
              if ( !needSameMonth || ( needSameMonth && hunter.get(Calendar.MONTH) == curProtoDate.get(Calendar.MONTH) ) ){
                if ( !needSameWeek || ( needSameWeek && hunter.get(Calendar.WEEK_OF_YEAR) == curProtoDate.get(Calendar.WEEK_OF_YEAR)) ){
                  if ( !needSameDay || ( needSameDay && hunter.get(Calendar.DAY_OF_YEAR) == curProtoDate.get(Calendar.DAY_OF_YEAR)) ){
                    result.add( hunter.clone() );
                  }
                }
              }
            }
            hunter.add( Calendar.WEEK_OF_YEAR, 1);
          }

        }
        else{
          println("in bwdms: finding specific");
          // they want a specific count
          result.add( huntDayOfWeek(curProtoDate, bd) );
        }
      }
    }

    return result;
View Full Code Here

public class ProcessHandler extends BaseAbstractHandler implements Handler {
   
    public ProcessHandler() {
        if ( (this.validParents == null) && (this.validPeers == null) ) {
            this.validParents = new HashSet();
            this.validParents.add( null );

            this.validPeers = new HashSet();
            this.validPeers.add( null );

            this.allowNesting = false;
        }
    }
View Full Code Here

import org.xml.sax.SAXParseException;

public class ConnectionHandler extends BaseAbstractHandler implements Handler {
  public ConnectionHandler() {
    if ((this.validParents == null) && (this.validPeers == null)) {
      this.validParents = new HashSet();
      this.validParents.add(NodeContainer.class);

      this.validPeers = new HashSet();
      this.validPeers.add(null);
      this.validPeers.add(Connection.class);

      this.allowNesting = false;
    }
View Full Code Here

public class InPortHandler extends BaseAbstractHandler
    implements
    Handler {
    public InPortHandler() {
        if ( (this.validParents == null) && (this.validPeers == null) ) {
            this.validParents = new HashSet();
            this.validParents.add( CompositeNode.class );

            this.validPeers = new HashSet();        
            this.validPeers.add( null );

            this.allowNesting = false;
        }
    }
View Full Code Here

public class MetaDataHandler extends BaseAbstractHandler
    implements
    Handler {
    public MetaDataHandler() {
        if ( (this.validParents == null) && (this.validPeers == null) ) {
            this.validParents = new HashSet();
            this.validParents.add( Node.class );

            this.validPeers = new HashSet();        
            this.validPeers.add( null );

            this.allowNesting = false;
        }
    }
View Full Code Here

public class WorkHandler extends BaseAbstractHandler implements Handler {
   
    public WorkHandler() {
        if ((this.validParents == null) && (this.validPeers == null)) {
            this.validParents = new HashSet();
            this.validParents.add(WorkItemNode.class);

            this.validPeers = new HashSet();
            this.validPeers.add(null);

            this.allowNesting = false;
        }
    }
View Full Code Here

public class FunctionImportHandler extends BaseAbstractHandler
    implements
    Handler {
    public FunctionImportHandler() {
        if ( (this.validParents == null) && (this.validPeers == null) ) {
            this.validParents = new HashSet();
            this.validParents.add( Process.class );

            this.validPeers = new HashSet();        
            this.validPeers.add( null );           

            this.allowNesting = false;
        }
    }
View Full Code Here

public class ImportHandler extends BaseAbstractHandler
    implements
    Handler {
    public ImportHandler() {
        if ( (this.validParents == null) && (this.validPeers == null) ) {
            this.validParents = new HashSet();
            this.validParents.add( Process.class );

            this.validPeers = new HashSet();        
            this.validPeers.add( null );           

            this.allowNesting = false;
        }
    }
View Full Code Here

TOP

Related Classes of java.util.HashSet$MyIterator

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.