NO FRAMES

Class IloCsvLine

Definition file: ilconcert/ilocsvreader.h

An instance of IloCsvLine represents a line in a csv file.

Constructor and Destructor Summary
public IloCsvLine()
public IloCsvLine(IloCsvLineI *)
public IloCsvLine(const IloCsvLine &)
Method Summary
public voidcopy(const IloCsvLine)
public IloBoolemptyFieldByHeader(const char *)
public IloBoolemptyFieldByPosition(IloInt)
public voidend()
public IloNumgetFloatByHeader(const char *)
public IloNumgetFloatByHeaderOrDefaultValue(const char *, IloNum)
public IloNumgetFloatByPosition(IloInt)
public IloNumgetFloatByPositionOrDefaultValue(IloInt, IloNum)
public IloCsvLineI *getImpl()
public IloIntgetIntByHeader(const char *)
public IloIntgetIntByHeaderOrDefaultValue(const char *, IloInt)
public IloIntgetIntByPosition(IloInt)
public IloIntgetIntByPositionOrDefaultValue(IloInt, IloInt)
public IloIntgetLineNumber()
public IloIntgetNumberOfFields()
public char *getStringByHeader(const char *)
public char *getStringByHeaderOrDefaultValue(const char *, const char *)
public char *getStringByPosition(IloInt)
public char *getStringByPositionOrDefaultValue(IloInt, const char *)
public voidoperator=(const IloCsvLine &)
public IloBoolprintValueOfKeys()
Constructor and Destructor Detail

IloCsvLine

public IloCsvLine()

This constructor creates a csv line object whose handle pointer is null. This object must be assigned before it can be used.


IloCsvLine

public IloCsvLine(IloCsvLineI * impl)

This constructor creates a handle object (an instance of IloCsvLine) from a pointer to an implementation object (an instance of the class IloCsvLineI).


IloCsvLine

public IloCsvLine(const IloCsvLine & csvLine)

This copy constructor creates a handle from a reference to a csv line object. The csv line object and csvLine both point to the same implementation object.


Method Detail

copy

public void copy(const IloCsvLine )

This member function returns the real number of the invoking csv line in the data file.


emptyFieldByHeader

public IloBool emptyFieldByHeader(const char * name)

This member function returns IloTrue if the field denoted by the string name in the invoking csv line is empty. Otherwise, it returns IloFalse


emptyFieldByPosition

public IloBool emptyFieldByPosition(IloInt i)

This member function returns IloTrue if the field denoted by i in the invoking csv line is empty. Otherwise, it returns IloFalse


end

public void end()

This member function deallocates the memory used by the csv line. If you no longer need a csv line, you can call this member function to reduce memory consumption.


getFloatByHeader

public IloNum getFloatByHeader(const char * name)

This member function returns the float contained in the field name in the invoking csv line.

If you have a loop in which you are getting a string, integer, or float by header on several lines with the same header name, it is better for performance to get the position of the header named name using the member function IloCsvReader::getPosition(name) than using IloCsvLine::getFloatByPosition (position of name in the header line).


getFloatByHeaderOrDefaultValue

public IloNum getFloatByHeaderOrDefaultValue(const char * name, IloNum defaultValue)

This member function returns the float contained in the field name in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


getFloatByPosition

public IloNum getFloatByPosition(IloInt i)

This member function returns the float contained in the field i in the invoking csv line.


getFloatByPositionOrDefaultValue

public IloNum getFloatByPositionOrDefaultValue(IloInt i, IloNum defaultValue)

This member function returns the float contained in the field i in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


getImpl

public IloCsvLineI * getImpl()

This member function returns a pointer to the implementation object corresponding to the invoking csv line.


getIntByHeader

public IloInt getIntByHeader(const char * name)

This member function returns the integer contained in the field name in the invoking csv line.

If you have a loop in which you are getting a string, integer, or float by header on several lines with the same header name, it is better for performance to get the position of the header named name using the member function IloCsvReader::getPosition(name) than using IloCsvLine::getIntByPosition (position of name in the header line).


getIntByHeaderOrDefaultValue

public IloInt getIntByHeaderOrDefaultValue(const char * name, IloInt defaultValue)

This member function returns the integer contained in the field name in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


getIntByPosition

public IloInt getIntByPosition(IloInt i)

This member function returns the integer contained in the field i in the invoking csv line.


getIntByPositionOrDefaultValue

public IloInt getIntByPositionOrDefaultValue(IloInt i, IloInt defaultValue)

This member function returns the integer contained in the field i in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


getLineNumber

public IloInt getLineNumber()

This member function returns the real number of the invoking csv line in the data file.


getNumberOfFields

public IloInt getNumberOfFields()

This member function returns the number of fields in the line.


getStringByHeader

public char * getStringByHeader(const char * name)

This member function returns a reference to the string contained in the field name in the invoking csv line.

If you have a loop in which you are getting a string, integer, or float by header on several lines with the same header name, it is better for performance to get the position of the header named name using the member function IloCsvReader::getPosition(name) than using IloCsvLine::getStringByPosition (position of name in the header line).


getStringByHeaderOrDefaultValue

public char * getStringByHeaderOrDefaultValue(const char * name, const char * defaultValue)

This member function returns the string contained in the field name in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


getStringByPosition

public char * getStringByPosition(IloInt i)

This member function returns a reference to the string contained in the field number i in the invoking csv line.


getStringByPositionOrDefaultValue

public char * getStringByPositionOrDefaultValue(IloInt i, const char * defaultValue)

This member function returns the string contained in the field i in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


operator=

public void operator=(const IloCsvLine & csvLine)

This operator assigns an address to the handle pointer of the invoking csv line. This address is the location of the implementation object of the argument csvLine.

After execution of this operator, the invoking csv line and csvLine both point to the same implementation object.


printValueOfKeys

public IloBool printValueOfKeys()

This member function prints the values of the keys fields in this line.