Examples of StringComparator


Examples of ca.coolman.util.StringComparator

   */
  protected void readResponse(InputStream input) throws IOException {
    Result result = Result.fromContent(input, Result.JSON);
    Vector tweets = result.getAsArray("/root");
    if (tweets.size() > 0) {
      final Comparator cmp = new StringComparator();
      for (Enumeration e = tweets.elements(); e.hasMoreElements(); ) {
        Result tweet = Result.fromContent((Hashtable)e.nextElement());
        String id = tweet.getAsString("id_str");
        if ((since_id == null) || cmp.compare(id, since_id) > 0) {
          // this is currently causing twitter to response with no tweets.
          //setSinceId(id);
        }
        if ((max_id == null) || cmp.compare(id, max_id) < 0) {
          // first glance you'd think max_id/since_id is backwards, but
          // read the
          // twitter page noted at the top of this class.
          setMaxId(id);
        }
View Full Code Here

Examples of com.liferay.util.StringComparator

    }

    groupName = groupName.trim();

    int pos = Arrays.binarySearch(
      _sortedSystemGroups, groupName, new StringComparator());

    if (pos >= 0) {
      return true;
    }
    else {
View Full Code Here

Examples of eu.stratosphere.api.common.typeutils.base.StringComparator

      try {
        MemoryManager mm = new DefaultMemoryManager(1024 * 1024);
        IOManager ioMan = new IOManager();
         
        TypeSerializer<String> serializer = StringSerializer.INSTANCE;
        TypeComparator<String> comparator = new StringComparator(true);
       
        reader = new BufferedReader(new FileReader(input));
        MutableObjectIterator<String> inputIterator = new StringReaderMutableObjectIterator(reader);
       
        sorter = new UnilateralSortMerger<String>(mm, ioMan, inputIterator, new DummyInvokable(),
View Full Code Here

Examples of jdbm.helper.StringComparator

            tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
        }

        dbFile = File.createTempFile( KeyBTreeCursorTest.class.getName(), "db", tmpDir );
        recman = new BaseRecordManager( dbFile.getAbsolutePath() );
        comparator = new StringComparator();
        bt = new BTree<String, byte[]>( recman, comparator );

        // add some data to it
        bt.insert( "0", Strings.EMPTY_BYTES, true );
        bt.insert( "1", Strings.EMPTY_BYTES, true );
View Full Code Here

Examples of jdbm.helper.StringComparator

            tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
        }

        dbFile = File.createTempFile( KeyCursorTest.class.getName(), "db", tmpDir );
        recman = new BaseRecordManager( dbFile.getAbsolutePath() );
        comparator = new StringComparator();
        bt = new BTree<String, byte[]>( recman, comparator );

        // add some data to it
        bt.insert( "0", Strings.EMPTY_BYTES, true );
        bt.insert( "1", Strings.EMPTY_BYTES, true );
View Full Code Here

Examples of jdbm.helper.StringComparator

                System.out.println( "Reloaded existing BTree with " + tree.size()
                                    + " famous people." );
            } else {
                // create a new B+Tree data structure and use a StringComparator
                // to order the records based on people's name.
                tree = BTree.createInstance( recman, new StringComparator() );
                recman.setNamedObject( BTREE_NAME, tree.getRecid() );
                System.out.println( "Created a new empty BTree" );
            }

            // insert people with their respective occupation
View Full Code Here

Examples of jdbm.helper.StringComparator

            tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
        }

        dbFile = File.createTempFile( KeyBTreeCursorTest.class.getName(), "db", tmpDir );
        recman = new BaseRecordManager( dbFile.getAbsolutePath() );
        comparator = new StringComparator();
        bt = BTree.createInstance( recman, comparator );

        // add some data to it
        bt.insert( "0", EMPTY_BYTES, true );
        bt.insert( "1", EMPTY_BYTES, true );
View Full Code Here

Examples of jdbm.helper.StringComparator

            tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
        }

        dbFile = File.createTempFile( KeyCursorTest.class.getName(), "db", tmpDir );
        recman = new BaseRecordManager( dbFile.getAbsolutePath() );
        comparator = new StringComparator();
        bt = BTree.createInstance( recman, comparator );

        // add some data to it
        bt.insert( "0", EMPTY_BYTES, true );
        bt.insert( "1", EMPTY_BYTES, true );
View Full Code Here

Examples of jdbm.helper.StringComparator

            tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
        }

        dbFile = File.createTempFile( KeyBTreeCursorTest.class.getName(), "db", tmpDir );
        recman = new BaseRecordManager( dbFile.getAbsolutePath() );
        comparator = new StringComparator();
        bt = new BTree<String, byte[]>( recman, comparator );

        // add some data to it
        bt.insert( "0", EMPTY_BYTES, true );
        bt.insert( "1", EMPTY_BYTES, true );
View Full Code Here

Examples of jdbm.helper.StringComparator

            tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
        }

        dbFile = File.createTempFile( KeyCursorTest.class.getName(), "db", tmpDir );
        recman = new BaseRecordManager( dbFile.getAbsolutePath() );
        comparator = new StringComparator();
        bt = new BTree<String, byte[]>( recman, comparator );

        // add some data to it
        bt.insert( "0", EMPTY_BYTES, true );
        bt.insert( "1", EMPTY_BYTES, true );
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.