Examples of StringComparator


Examples of org.apache.felix.connect.felix.framework.util.StringComparator

    public CapabilitySet(List<String> indexProps, boolean caseSensitive)
    {
        m_indices = (caseSensitive)
            ? new TreeMap<String, Map<Object, Set<BundleCapability>>>()
            : new TreeMap<String, Map<Object, Set<BundleCapability>>>(
                        new StringComparator(false));
        for (int i = 0; (indexProps != null) && (i < indexProps.size()); i++)
        {
            m_indices.put(
                indexProps.get(i), new HashMap<Object, Set<BundleCapability>>());
        }
View Full Code Here

Examples of org.apache.felix.framework.util.StringComparator

    public CapabilitySet(List<String> indexProps, boolean caseSensitive)
    {
        m_indices = (caseSensitive)
            ? new TreeMap<String, Map<Object, Set<BundleCapability>>>()
            : new TreeMap<String, Map<Object, Set<BundleCapability>>>(
                new StringComparator(false));
        for (int i = 0; (indexProps != null) && (i < indexProps.size()); i++)
        {
            m_indices.put(
                indexProps.get(i), new HashMap<Object, Set<BundleCapability>>());
        }
View Full Code Here

Examples of org.apache.felix.framework.util.StringComparator

    public CapabilitySet(List<String> indexProps, boolean caseSensitive)
    {
        m_indices = (caseSensitive)
            ? new TreeMap<String, Map<Object, Set<BundleCapability>>>()
            : new TreeMap<String, Map<Object, Set<BundleCapability>>>(
                new StringComparator(false));
        for (int i = 0; (indexProps != null) && (i < indexProps.size()); i++)
        {
            m_indices.put(
                indexProps.get(i), new HashMap<Object, Set<BundleCapability>>());
        }
View Full Code Here

Examples of org.apache.flink.api.common.typeutils.base.StringComparator

  protected TupleComparator<Tuple3<Integer, String, Double>> createComparator(boolean ascending) {
    return new TupleComparator<Tuple3<Integer, String, Double>>(
        new int[]{0, 1},
        new TypeComparator[]{
          new IntComparator(ascending),
          new StringComparator(ascending)
        },
    new TypeSerializer[]{ IntSerializer.INSTANCE, StringSerializer.INSTANCE, DoubleSerializer.INSTANCE });
  }
View Full Code Here

Examples of org.cafesip.gwtcomp.client.utils.StringComparator

    {
        getTitleBar().setText("Context List");
        getTitleBar().setLevel(2);

        ColumnProperty[] cp = new ColumnProperty[] {
                new ColumnProperty("Name", new StringComparator(0, true),
                        new StringComparator(0, false)),
                new ColumnProperty("Description", null, null),
                new ColumnProperty("Path", null, null),
                new ColumnProperty("Type", new StringComparator(3, true),
                        new StringComparator(3, false)),
                new ColumnProperty("Operations", null, null) };
        cp[4].setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
       
        SuperTableProperty property = new SuperTableProperty();
        property.setPagingEnabled(true);
View Full Code Here

Examples of org.cafesip.gwtcomp.client.utils.StringComparator

        getTitleBar().setLevel(2);

        getMessageBar().setVisible(false);

        ColumnProperty[] cp = new ColumnProperty[] {
                new ColumnProperty("Name", new StringComparator(0, true),
                        new StringComparator(0, false)),
                new ColumnProperty("Description", null, null),
                new ColumnProperty("Context", new StringComparator(2, true),
                        new StringComparator(2, false)),
                new ColumnProperty("Connector", new StringComparator(3, true),
                        new StringComparator(3, false)),
                new ColumnProperty("Security", null, null),
                new ColumnProperty("Operations", null, null) };
        cp[1].setWidth("40%");

        SuperTableProperty property = new SuperTableProperty();
View Full Code Here

Examples of org.cafesip.gwtcomp.client.utils.StringComparator

                }
            }
        }

        ColumnProperty[] cp = new ColumnProperty[] {
                new ColumnProperty("Name", new StringComparator(0, true),
                        new StringComparator(0, false)),
                new ColumnProperty("Default Realm", new BooleanComparator(1,
                        true), new BooleanComparator(1, false)),
                new ColumnProperty("Path", new StringComparator(2, true),
                        new StringComparator(2, false)),
                new ColumnProperty("Operations", null, null) };
        cp[1].setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        cp[3].setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);       

        SuperTableProperty property = new SuperTableProperty();
View Full Code Here

Examples of org.cafesip.gwtcomp.client.utils.StringComparator

                }
            }
        }

        ColumnProperty[] cp = new ColumnProperty[] {
                new ColumnProperty("Name", new StringComparator(0, true),
                        new StringComparator(0, false)),
                new ColumnProperty("Default", new BooleanComparator(1, true),
                        new BooleanComparator(1, false)),
                new ColumnProperty("Max. Threads", new NumericComparator(2,
                        true), new NumericComparator(2, false)),
                new ColumnProperty("Min. Threads", new NumericComparator(3,
                        true), new NumericComparator(3, false)),
                new ColumnProperty("Stack Vendor",
                        new StringComparator(4, true), new StringComparator(4,
                                false)),
                new ColumnProperty("Operations", null, null) };
        cp[1].setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        cp[5].setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        SuperTableProperty property = new SuperTableProperty();
View Full Code Here

Examples of org.eclipse.compare.StringComparator

      return;
    }
       
       
    // Compute LCS
    StringComparator left = new StringComparator(pl.toString());
    StringComparator right = new StringComparator(pr.toString());
    org.eclipse.compare.internal.LCSSettings settings = new org.eclipse.compare.internal.LCSSettings();
   
    RangeDifference[] rd = RangeDifferencer.findRanges(settings, left, right);
   
    // Debug Output
    if (log.isDebugEnabled()) {
      log.debug("\n\n RangeDifferences \n\n");                 
          for (int x=0; x<rd.length; x++) {   
            log.debug (
                toRangeString( left, rd[x].leftStart(), rd[x].leftLength(), true )
                + rd[x].kindString()
                + toRangeString( right, rd[x].rightStart(), rd[x].rightLength(), true ) );
          }
    }
       
        // Now build appropriate replacement paragraph content
        List<Object> pLeftReplacement = new ArrayList<Object>();
        List<Object> pRightReplacement = new ArrayList<Object>();
       
        // Which of the _existing_ w:r we are up to
        int pLeftIndex = 0;
        int pRightIndex = 0;     
   
    int[] leftCounts = getParagraphRunTextWordCounts(pl);
   
//      StringBuilder debug = new StringBuilder();
//      debug.append("{ ");
//    for (int i=0; i < leftCounts.length; i++) {
//        try {
//        debug.append( leftCounts[i] + ", ");
//      } catch (RuntimeException e) {
//      }
//    }
//      System.out.println(debug);
   
    int[] rightCounts = getParagraphRunTextWordCounts(pr);
   
    int leftWordCounter = -1;
    int rightWordCounter = -1;
       
        for (int x=0; x<rd.length; x++) {
       
          // The original runs are always longer than
          // each rd

        // We will definitely require a new run
        // structure for each side
        R currentLeftStructure = createRunStructure("",
            pl, pLeftIndex );
          R currentRightStructure = createRunStructure("",
            pr, pRightIndex );
         
          pLeftReplacement.add(currentLeftStructure);
          pRightReplacement.add(currentRightStructure);
         
          if (rd[x].kind() == RangeDifference.NOCHANGE) {
            log.debug("NOCHANGE");
            // These are part of the string LCS,
            // (though they might not be part of the
            //  XML LCS once we've added their rPr
            //  back in.) 
            // This is where we focus our efforts.
           
                         
            // Process the words in rd[x] one word at a time
                for (int i=rd[x].leftStart(); // left and right are identical
                     i<(rd[x].leftStart()+rd[x].leftLength()); i++) {

                // Our objective is to ensure that both the
                // left and right paragraphs end up with
                // matching w:r/w:t boundaries.
               
                // So when either of the existing paragraphs
                // contains a boundary, this need to be inserted
                // in both results
                 
                  String word = left.getLeaf(i);
                 
                  leftWordCounter++;
                  rightWordCounter++;
                 
//                log.debug(word);
                 
                  if ( leftWordCounter < sum(leftCounts, 0, pLeftIndex)
                      && rightWordCounter < sum(rightCounts, 0, pRightIndex) ) {
                   
                    // it is ok to insert into current w:t
                    addWord(currentLeftStructure, word);
                    addWord(currentRightStructure, word);                   
                   
                  } else
                   
//                    log.debug("Hit boundary");
                   
                    // which boundary have we hit?
                    if (leftWordCounter == sum(leftCounts, 0, pLeftIndex)
                        && rightWordCounter  == sum(rightCounts, 0, pRightIndex) ) {
                      // Quite likely, for example, same formatting in each
                     
                      // We're now on to each paragraph's next w:t
                        pLeftIndex++;
                        pRightIndex++;
                     
                    } else if (leftWordCounter == sum(leftCounts, 0, pLeftIndex) ) {
                     
                      // We're now on to the left paragraph's next w:t
                        pLeftIndex++;
                     
                    } else {
                   
                      // We're now on to the right paragraph's next w:t
                        pRightIndex++;
                    }
                   
                    currentLeftStructure = createRunStructure(word,
                        pl, pLeftIndex );
                      currentRightStructure = createRunStructure(word,
                        pr, pRightIndex );
                     
                      pLeftReplacement.add(currentLeftStructure);
                      pRightReplacement.add(currentRightStructure);
                   
                  }
                 
                }                       
               
          } else if (rd[x].kind() == RangeDifference.CHANGE) {
            log.debug("CHANGE");
            // These aren't part of the string LCS,
            // (so they shouldn't be part of
            //  the XML LCS)
           
            // All we need to do is make sure that
            // the input is round tripped.
                                     
            // Left side: Process the words in rd[x] one word at a time
              // NB, can't just copy existing runs into the output             
            log.debug(".. left side");
                for (int i=rd[x].leftStart();
                     i<(rd[x].leftStart()+rd[x].leftLength()); i++) {
                                   
                  String word = left.getLeaf(i);
//                log.debug(word);
                  leftWordCounter++;
                 
                  if ( leftWordCounter < sum(leftCounts, 0, pLeftIndex) ) {
                  // it is ok to insert into left's current w:t
                    addWord(currentLeftStructure, word);
                  } else {                   
                    // boundary hit                     
                  // We're now on to the left paragraph's next w:t
                    pLeftIndex++;
                    currentLeftStructure = createRunStructure(word,
                        pl, pLeftIndex );
                      pLeftReplacement.add(currentLeftStructure);
                  }
                 
                }                       
           
            // Right side
            log.debug(".. right side");
                for (int i=rd[x].rightStart();
                     i<(rd[x].rightStart()+rd[x].rightLength()); i++) {
                 
                  String word = right.getLeaf(i);
                log.debug(word);
                  rightWordCounter++;
                 
                  if ( rightWordCounter < sum(rightCounts, 0, pRightIndex) ) {
                    // it is ok to insert into right's current w:t
View Full Code Here

Examples of org.hsqldb.lib.StringComparator

            String     absolute = new File(directory).getAbsolutePath();

            filelist = new File(absolute).list();

            ArraySort.sort((Object[]) filelist, 0, filelist.length,
                           new StringComparator());

            for (int i = 0; i < filelist.length; i++) {
                String fname = filelist[i];

                if (fname.startsWith("TestSelf") && fname.endsWith(".txt")) {
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.