Examples of indexOf()


Examples of elemental.util.ArrayOfInt.indexOf()

    // Now join them together in harmony.
    assertEquals("3$4$5", array.join("$"));

    for (int i = 0, n = items.length; i < n; ++i) {
      assertEquals(i, array.indexOf(newItems[i]));
      assertTrue(array.contains(newItems[i]));
    }

    final int imposter = 100;
    assertEquals(-1, array.indexOf(imposter));
View Full Code Here

Examples of elemental.util.ArrayOfString.indexOf()

    // Now join them together in harmony.
    assertEquals("three goats$four goats$SQUIRREL!", array.join("$"));

    for (int i = 0, n = items.length; i < n; ++i) {
      assertEquals(i, array.indexOf(newItems[i]));
      assertTrue(array.contains(newItems[i]));
    }

    final String imposter = "Pajamas?";
    assertEquals(-1, array.indexOf(imposter));
View Full Code Here

Examples of gnu.java.lang.CPStringBuilder.indexOf()

      {
        // Replace the target with the replacement
        result.replace(startPos, startPos + targetLength, replaceString);

        // Search for a new occurrence of the target
        startPos = result.indexOf(targetString, startPos + replaceLength);
      }
    return result.toString();
  }
 
  /**
 
View Full Code Here

Examples of gnu.trove.list.TIntList.indexOf()

    }

    public void unwatch(IntVar var, Nogood ng) {
        TIntList nogoods = vars2nogood.get(var.getId());
        if (nogoods != null) {
            int ni = nogoods.indexOf(ng.getIdx());
            if (ni > -1) {
                nogoods.removeAt(ni);
                TIntList indices = vars2idxinng.get(var.getId());
                indices.removeAt(ni);
            }
View Full Code Here

Examples of gnu.trove.list.array.TDoubleArrayList.indexOf()

      //      System.out.println("max_idx: " + mi + " " + perIterScores.toString());
      double maxScore = perIterScores.get(mi); // perIterScores.max();
      if (algo2BestScore.size() == 0 || algo2BestScore.get(algo) < maxScore) {
        //        System.out.println("new best score: " + maxScore);
        // best iteration
        int bestIter = perIterScores.indexOf(maxScore) + 1;

        algo2BestScore.put(algo, maxScore);
        algo2BestConfig.put(algo, (Hashtable) config.clone());
        algo2BestConfig.get(algo).put("iters", bestIter);
      }
View Full Code Here

Examples of gov.nasa.worldwind.layers.LayerList.indexOf()

        LayerList layers = wwd.getModel().getLayers();
       
        for (Layer l : layers)
        {
            if (l instanceof PlaceNameLayer)
                compassPosition = layers.indexOf(l);
        }
       
        layers.add(compassPosition, layer);
    }
  
View Full Code Here

Examples of io.netty.buffer.ByteBuf.indexOf()

        ByteBuf line = readLine();
        if (line == null) {
            return false;
        }

        int space = line.indexOf(line.readerIndex(), line.readerIndex() + line.readableBytes(), (byte) ' ');
        if (space < 0) {
            setError(Error.INVALID_METHOD);
            return false;
        }
View Full Code Here

Examples of io.netty.buffer.ChannelBuffer.indexOf()

        }

        ChannelBuffer binaryData = buffer.readBytes(frameSize);
        buffer.skipBytes(1);

        int ffDelimPos = binaryData.indexOf(binaryData.readerIndex(), binaryData.writerIndex(), (byte) 0xFF);
        if (ffDelimPos >= 0) {
            throw new IllegalArgumentException("a text frame should not contain 0xFF.");
        }

        return new TextWebSocketFrame(binaryData);
View Full Code Here

Examples of it.unimi.dsi.fastutil.ints.IntArrayList.indexOf()

      if ( split >= 0 ) {
        final String fieldName = qualifiedSizes[ i ].substring( 0, split );
        final int field = factory.fieldIndex( fieldName );
        if ( field < 0 ) throw new IllegalArgumentException( "Field " + fieldName + " is not part of factory " + factory.getClass().getName() );
        if ( !indexedFields.contains( field ) ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not being indexed" );
        size[ indexedFields.indexOf( field ) ] = (int)LongSizeStringParser.parseSize( qualifiedSizes[ i ].substring( split + 1 ) );
      }
    }
    return size;
  }
View Full Code Here

Examples of it.unimi.dsi.lang.MutableString.indexOf()

    int f, q;
    reader.readLine( line );
    while( reader.readLine( line ) != null ) {
      if ( line.charAt( 0 ) == '#' ) {
        number = line.substring( 2 );
        f = Integer.parseInt( number.delete( number.indexOf( ' ' ), number.length() ).toString() );
        double freq = (double)gc[ f ] / numberOfoccurrences;
        if ( print ) System.out.println( line + " " + format( freq ) );
        else {
          if ( quantumBitLength != 0 ) {
            // We choose using the quantum bit length
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.