NO FRAMES

Class IloIntervalListCursor

Definition file: ilconcert/ilointervals.h
Inspects the intervals of an interval list.

An instance of the class IloIntervalListCursor allows you to inspect the intervals of an interval list, that is, an instance of IloIntervalList. Cursors are intended to iterate forward or backward over the intervals of an interval list.

Note
The structure of the interval list cannot be changed while a cursor is being used to inspect it. Therefore, functions that change the structure of the interval list, such as IloIntervalList::addInterval, should not be called while the cursor is being used.

See Also:

Constructor and Destructor Summary
public IloIntervalListCursor(const IloIntervalList)
public IloIntervalListCursor(const IloIntervalList, IloNum x)
public IloIntervalListCursor(const IloIntervalListCursor &)
Method Summary
public IloNumgetEnd() const
public IloNumgetStart() const
public IloNumgetType() const
public IloBoolok() const
public voidoperator++()
public voidoperator--()
public voidoperator=(const IloIntervalListCursor &)
public voidseek(IloNum)
Constructor and Destructor Detail

IloIntervalListCursor

public IloIntervalListCursor(const IloIntervalList)

This constructor creates a cursor to inspect the interval list argument. This cursor lets you iterate forward or backward over the intervals of the interval list. The cursor initially specifies the first interval of the interval list.


IloIntervalListCursor

public IloIntervalListCursor(const IloIntervalList, IloNum x)

This constructor creates a cursor to inspect the interval list intervals. This cursor lets you iterate forward or backward over the interval list. The cursor initially specifies the interval of the interval list that contains x.

Note that if n is the number of intervals of the interval list given as argument, the worst-case complexity of this constructor is O(log(n)).


IloIntervalListCursor

public IloIntervalListCursor(const IloIntervalListCursor &)

This constructor creates a new cursor that is a copy of the argument. The new cursor initially specifies the same interval and the same interval list as the argument cursor.


Method Detail

getEnd

public IloNum getEnd() const

This member function returns the end point of the interval currently specified by the cursor.


getStart

public IloNum getStart() const

This member function returns the start point of the interval currently specified by the cursor.


getType

public IloNum getType() const

This member function returns the type of the interval currently specified by the cursor.


ok

public IloBool ok() const

This member function returns IloFalse if the cursor does not currently specify an interval included in the interval list. Otherwise, it returns IloTrue.


operator++

public void operator++()

This operator moves the cursor to the interval adjacent to the current interval (forward move).


operator--

public void operator--()

This operator moves the cursor to the interval adjacent to the current interval (backward move).


operator=

public void operator=(const IloIntervalListCursor &)

This operator assigns an address to the handle pointer of the invoking instance of IloIntervalListCursor. That address is the location of the implementation object of the argument cursor. After the execution of this operator, the invoking object and cursor both point to the same implementation object.


seek

public void seek(IloNum)

This member function sets the cursor to specify the first interval of the interval list whose end is strictly greater than x. Note that if n is the number of intervals of the interval list traversed by the invoking iterator, the worst-case complexity of this member function is O(log(n)). An instance of IloException is thrown if x does not belong to the interval of definition of the invoking interval list.