in src/com/amazon/ion/impl/SymbolTableReader.java [558:651]
private final boolean has_next_helper()
{
// this just tells us whether or not we have more
// value coming at our current scanning depth
switch (_current_state)
{
case S_BOF:
// outer struct always follows
return true;
case S_STRUCT:
// only top level value
return false;
case S_IN_STRUCT:
if (stateFirstInStruct() != S_STRUCT_CLOSE) {
return true;
}
return false;
case S_NAME:
// if we have name we have version
return true;
case S_VERSION:
if (hasMaxId()) {
return true;
}
if (stateFollowingMaxId() != S_STRUCT_CLOSE) {
return true;
}
return false;
case S_MAX_ID:
// maybe something follows, but not always
if (stateFollowingMaxId() != S_STRUCT_CLOSE) {
return true;
}
return false;
case S_IMPORT_LIST:
// locals are the only thing that might follow imports
if (hasLocalSymbols()) return true;
return false;
case S_IN_IMPORTS:
case S_IMPORT_STRUCT:
// we have more if there is
boolean more_imports = _import_iterator.hasNext();
return more_imports;
case S_IN_IMPORT_STRUCT:
case S_IMPORT_NAME:
// we always have a name and version
return true;
case S_IMPORT_VERSION:
// we always have a max_id on imports
return true;
case S_IMPORT_MAX_ID:
case S_IMPORT_STRUCT_CLOSE:
return false;
case S_IMPORT_LIST_CLOSE:
return false;
case S_AFTER_IMPORT_LIST:
// locals are the only thing that might follow imports
if (hasLocalSymbols()) return true;
return false;
case S_SYMBOL_LIST:
// the symbol list is the last member, so it has no "next sibling"
// but ... just in case we put something after the local symbol list
assert(stateFollowingLocalSymbols() == S_STRUCT_CLOSE);
return false;
case S_IN_SYMBOLS:
case S_SYMBOL:
if (_local_symbols.hasNext()) return true;
return false;
case S_SYMBOL_LIST_CLOSE:
case S_STRUCT_CLOSE:
case S_EOF:
// these are all at the end of their respective containers
return false;
default:
throwUnrecognizedState(_current_state);
return false;
}
}