added a new method: ItemTable::hasIndex().

Some lines uses 'indexVector.empty()' to check if a table has
indexes. Using this function makes the mean of the lines clear.