cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/network/topologies/readers/TopologyReaderBrite.java
private <T extends Number> boolean parseLine(String nodeLine, T[] parsedFields, Function<String, T> castFunction){
        final StringTokenizer tokenizer = new StringTokenizer(nodeLine);
        if (!tokenizer.hasMoreElements()) {
            return false;
        }

        for (int i = 0; tokenizer.hasMoreElements() && i < parsedFields.length; i++) {
            parsedFields[i] = castFunction.apply(tokenizer.nextToken());
        }

        return true;
    }
/**
     * Gets a line from a file and parses its fields, considering that all fields have the same type.
     *
     * @param nodeLine the line to be parsed
     * @param parsedFields an output array that will be filled with the values of the parsed fields.
     *                     The array is given empty and returned with the parsed values.
     *                     The number of elements in the array defines the number of fields to be parsed.
     * @param castFunction a function that will convert the String value from each parsed field to
     *                     the value of the elements of the output array.
     * @param <T>          the type of the values of the output array
     * @return true if any field was parsed, false otherwise
     */
Gets a line from a file and parses its fields, considering that all fields have the same type.
@param nodeLine the line to be parsed
@param parsedFields an output array that will be filled with the values of the parsed fields.
The array is given empty and returned with the parsed values.
The number of elements in the array defines the number of fields to be parsed.
@param castFunction a function that will convert the String value from each parsed field to
the value of the elements of the output array.
@param           the type of the values of the output array
@return true if any field was parsed, false otherwise
Gets a line from a file and parses its fields considering that all fields have the same type . @param nodeLine the line to be parsed @param parsedFields an output array that will be filled with the values of the parsed fields . The array is given empty and returned with the parsed values . The number of elements in the array defines the number of fields to be parsed . @param castFunction a function that will convert the String value from each parsed field to the value of the elements of the output array . @param the type of the values of the output array @return true if any field was parsed false otherwise
private <T extends Number> boolean parseLine(String nodeLine, T[] parsedFields, Function<String, T> castFunction){
        final StringTokenizer tokenizer = new StringTokenizer(nodeLine);
        if (!tokenizer.hasMoreElements()) {
            return false;
        }
        for (int i = 0; tokenizer.hasMoreElements() && i < parsedFields.length; i++) {
            parsedFields[i] = castFunction.apply(tokenizer.nextToken());
        }
        return true;
    }
private < T extends Number > boolean parseLine ( String nodeLine , T [ ] parsedFields , Function < String , T > castFunction ) { final StringTokenizer tokenizer = new StringTokenizer ( nodeLine ) ; if ( ! tokenizer . hasMoreElements ( ) ) { return false ; } for ( int i = 0 ; tokenizer . hasMoreElements ( ) && i < parsedFields . length ; i ++ ) { parsedFields [ i ] = castFunction . apply ( tokenizer . nextToken ( ) ) ; } return true ; }
Gets a line from a file and parses its fields, considering that all fields have the same type.
Gets a line from a file and parses its fields considering that all fields have the same type .