Examples of indexOf()


Examples of org.apache.http.util.CharArrayBuffer.indexOf()

    }

    public void testIndexOf() {
        CharArrayBuffer buffer = new CharArrayBuffer(16);
        buffer.append("name: value");
        assertEquals(4, buffer.indexOf(':'));
        assertEquals(-1, buffer.indexOf(','));
        assertEquals(4, buffer.indexOf(':', -1, 11));
        assertEquals(4, buffer.indexOf(':', 0, 1000));
        assertEquals(-1, buffer.indexOf(':', 2, 1));
    }
View Full Code Here

Examples of org.apache.james.mime4j.io.BufferedLineReaderInputStream.indexOf()

            inbuffer.byteAt(20);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        try {
            inbuffer.indexOf(b2, -1, 3);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        try {
            inbuffer.indexOf(b2, 1, 3);
View Full Code Here

Examples of org.apache.james.mime4j.util.ByteArrayBuffer.indexOf()

            }
            fieldbuf.setLength(len);
           
            boolean valid = true;
           
            int pos = fieldbuf.indexOf((byte) ':');
            if (pos <= 0) {
                monitor(Event.INALID_HEADER);
                valid = false;
            } else {
                for (int i = 0; i < pos; i++) {
View Full Code Here

Examples of org.apache.james.mime4j.util.CharArrayBuffer.indexOf()

    }

    public void testIndexOf() {
        CharArrayBuffer buffer = new CharArrayBuffer(16);
        buffer.append("name: value");
        assertEquals(4, buffer.indexOf(':'));
        assertEquals(-1, buffer.indexOf(','));
        assertEquals(4, buffer.indexOf(':', -1, 11));
        assertEquals(4, buffer.indexOf(':', 0, 1000));
        assertEquals(-1, buffer.indexOf(':', 2, 1));
    }
View Full Code Here

Examples of org.apache.kahadb.util.ByteSequence.indexOf()

        byte data[] = new byte[1024*4];
        ByteSequence bs = new ByteSequence(data, 0, reader.read(offset, data));

        int pos = 0;
        while( true ) {
            pos = bs.indexOf(header, pos);
            if( pos >= 0 ) {
                return offset+pos;
            } else {
                // need to load the next data chunck in..
                if( bs.length != data.length ) {
View Full Code Here

Examples of org.apache.lucene.index.TermFreqVector.indexOf()

    float[] allTermScoreVect = getTermScoreVector();
    float[] termScoreVect = new float[allTermScoreVect.length];
    TermFreqVector freqVector = getTermFreqVector();

    for(String term: terms){
      int idx = freqVector.indexOf(term); // does a binary search
      if( idx == -1 ) continue;
      termScoreVect[idx] = allTermScoreVect[idx];
    }

    return termScoreVect;
View Full Code Here

Examples of org.apache.lucene.index.TermPositionVector.indexOf()

    // just return to make null snippet if un-matched fieldName specified when fieldMatch == true
    if( termSet == null ) return;
   
    for( String term : tpv.getTerms() ){
      if( !termSet.contains( term ) ) continue;
      int index = tpv.indexOf( term );
      TermVectorOffsetInfo[] tvois = tpv.getOffsets( index );
      if( tvois == null ) return; // just return to make null snippets
      int[] poss = tpv.getTermPositions( index );
      if( poss == null ) return; // just return to make null snippets
      for( int i = 0; i < tvois.length; i++ )
View Full Code Here

Examples of org.apache.metamodel.data.DefaultRow.indexOf()

            for (int i = 0; i < resultRows.size(); i++) {
                Row row = resultRows.get(i);
                Object[] values = row.getValues();
                for (Entry<SelectItem, Object> entry : functionResult.entrySet()) {
                    SelectItem item = entry.getKey();
                    int itemIndex = row.indexOf(item);
                    if (itemIndex != -1) {
                        Object value = entry.getValue();
                        values[itemIndex] = value;
                    }
                }
View Full Code Here

Examples of org.apache.metamodel.data.Row.indexOf()

                Map<SelectItem, List<Object>> functionInput = entry.getValue();
                Object[] resultRow = new Object[selectItems.size()];
                // Loop through select items to generate a row
                int i = 0;
                for (SelectItem item : selectItems) {
                    int uniqueRowIndex = row.indexOf(item);
                    if (uniqueRowIndex != -1) {
                        // If there's already a value for the select item in the
                        // row, keep it (it's one of the grouped by columns)
                        resultRow[i] = row.getValue(uniqueRowIndex);
                    } else {
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.indexOf()

            buf.put((byte) 0x3);
            buf.put((byte) 0x4);
            buf.position(2);
            buf.limit(5);

            assertEquals(4, buf.indexOf((byte) 0x1));
            assertEquals(-1, buf.indexOf((byte) 0x2));
            assertEquals(2, buf.indexOf((byte) 0x3));
            assertEquals(3, buf.indexOf((byte) 0x4));
        }
    }
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.