Top Description Inners Fields Constructors Methods
com.amazon.ion.impl

pack-priv Class LocalSymbolTable

extends Object
implements _Private_LocalSymbolTable
Class Inheritance
All Implemented Interfaces
com.amazon.ion.impl._Private_LocalSymbolTable, com.amazon.ion.SymbolTable
Known Direct Subclasses
com.amazon.ion.impl.LocalSymbolTableAsStruct
Static Imports
com.amazon.ion.SystemSymbols.IMPORTS, .SystemSymbols.IMPORTS_SID, .SystemSymbols.ION, .SystemSymbols.ION_SYMBOL_TABLE, .SystemSymbols.MAX_ID_SID, .SystemSymbols.NAME_SID, .SystemSymbols.SYMBOLS_SID, .SystemSymbols.VERSION_SID, com.amazon.ion.impl._Private_Utils.copyOf, ._Private_Utils.getSidForSymbolTableField, ._Private_Utils.safeEquals

A local symbol table.

Instances of this class are safe for use by multiple threads.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
private static class

Field Summary

Modifier and TypeField and Description
private static final int
DEFAULT_CAPACITY

The initial length of mySymbolNames.

pack-priv static final LocalSymbolTable.Factory
private boolean
isReadOnly

Whether this symbol table is read only, and thus, immutable.

pack-priv final int
myFirstLocalSid

The sid of the first local symbol, which is stored at mySymbolNames[0].

private final LocalSymbolTableImports
myImportsList

The system and shared symtabs imported by this symtab.

pack-priv String[]
mySymbolNames

The local symbol names declared in this symtab; never null.

pack-priv int
mySymbolsCount

This is the number of symbols defined in this symbol table locally, that is not imported from some other table.

private final Map<String, Integer>
mySymbolsMap

Map of symbol names to symbol ids of local symbols that are not in imports.

Constructor Summary

AccessConstructor and Description
protected
LocalSymbolTable(LocalSymbolTableImports
never null
imports
,
List<String>
may be null or empty
symbolsList
)

protected
LocalSymbolTable(LocalSymbolTable other, int maxId)

Copy-constructor, performs defensive copying of member fields where necessary.

Method Summary

Modifier and TypeMethod and Description
private void
public SymbolToken
find(String
the symbol text to find.
text
)

Implements com.amazon.ion.SymbolTable.find.

Finds a symbol already interned by this table.

public String
findKnownSymbol(int
the requested symbol ID.
id
)

Implements com.amazon.ion.SymbolTable.findKnownSymbol.

Gets the interned text for a symbol ID.

private int
public int
findSymbol(String
must not be null or empty.
name
)

Implements com.amazon.ion.SymbolTable.findSymbol.

Gets the symbol ID associated with a given symbol name.

public int
getImportedMaxId()

Implements com.amazon.ion.SymbolTable.getImportedMaxId.

Gets the highest symbol id reserved by this table's imports (including system symbols).

public SymbolTable[]
getImportedTables()

Implements com.amazon.ion.SymbolTable.getImportedTables.

Gets the sequence of shared symbol tables imported by this (local) symbol table.

public SymbolTable[]
getImportedTablesNoCopy()

Implements com.amazon.ion.impl._Private_LocalSymbolTable.getImportedTablesNoCopy.

Returns the imported symbol tables without making a copy.

public String
getIonVersionId()

Implements com.amazon.ion.SymbolTable.getIonVersionId.

Gets the identifier for the Ion version (and thus the system symbol table) used by this table.

public synchronized int
getMaxId()

Implements com.amazon.ion.SymbolTable.getMaxId.

Gets the highest symbol id reserved by this table.

public String
getName()

Implements com.amazon.ion.SymbolTable.getName.

Gets the unique name of this symbol table.

public SymbolTable
getSystemSymbolTable()

Implements com.amazon.ion.SymbolTable.getSystemSymbolTable.

Gets the system symbol table being used by this local table.

public int
getVersion()

Implements com.amazon.ion.SymbolTable.getVersion.

Gets the version of this symbol table.

public synchronized SymbolToken
intern(String
the symbol text to intern.
text
)

Implements com.amazon.ion.SymbolTable.intern.

Adds a new symbol to this table, or finds an existing definition of it.

public boolean
isLocalTable()

Implements com.amazon.ion.SymbolTable.isLocalTable.

Determines whether this symbol table is local, and therefore unnamed and unversioned.

public synchronized boolean
isReadOnly()

Implements com.amazon.ion.SymbolTable.isReadOnly.

Determines whether this symbol table can have symbols added to it.

public boolean
isSharedTable()

Implements com.amazon.ion.SymbolTable.isSharedTable.

Determines whether this symbol table is shared, and therefore named, versioned, and read-only.

public boolean
isSubstitute()

Implements com.amazon.ion.SymbolTable.isSubstitute.

Determines whether this instance is substituting for an imported shared table for which no exact match was found in the catalog.

public boolean
isSystemTable()

Implements com.amazon.ion.SymbolTable.isSystemTable.

Determines whether this symbol table is a system symbol table, and therefore shared, named, versioned, and read-only.

public synchronized Iterator<String>
iterateDeclaredSymbolNames()

Implements com.amazon.ion.SymbolTable.iterateDeclaredSymbolNames.

Creates an iterator that will return all non-imported symbol names, in order of their symbol IDs.

public synchronized _Private_LocalSymbolTable
pack-priv synchronized LocalSymbolTable
makeCopy(int maxId)

public synchronized void
makeReadOnly()

Implements com.amazon.ion.SymbolTable.makeReadOnly.

Prevents this symbol table from accepting any more new symbols.

private static void
prepImportsList(List<SymbolTable> importsList, IonReader reader, IonCatalog catalog)

Collects the necessary imports from the reader and catalog, and load them into the passed-in importsList.

pack-priv int
putSymbol(String symbolName)

NOT SYNCHRONIZED!

private static void
putToMapIfNotThere(Map<String, Integer> symbolsMap, String text, int sid)

protected static LocalSymbolTableImports

Returns:

a new LocalSymbolTableImports instance, or null if this was an LST append. If null, `currentSymbolTable` continues to be the active symbol table.
readLocalSymbolTable
(IonReader
the reader from which to parse the symbol table.
reader
,
IonCatalog
the catalog from which to resolve shared symbol table imports.
catalog
,
boolean
true if the reader is already positioned on the symbol table struct; otherwise, false.
isOnStruct
,
List<String>
list into which local symbols declared by the parsed symbol table will be deposited.
symbolsListOut
,
SymbolTable
the symbol table currently active in the stream.
currentSymbolTable
)

Parses the symbol table at the reader's current position.

private static SymbolTable

Returns:

symbol table representation of the import; null if the import declaration is malformed
readOneImport
(IonReader ionRep, IonCatalog catalog)

Returns a SymbolTable representation of a single import declaration from the passed-in reader and catalog.

pack-priv boolean
symtabExtends(SymbolTable other)

This method, and the context from which it is called, assumes that the symtabs are not being mutated by another thread.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public static String

Returns:

the symbol name, of the form $NNN where NNN is the integer rendering of id
unknownSymbolName
(int
must be a value greater than zero.
id
)

Generate the string representation of a symbol with an unknown id.

private static final void
public void
writeTo(IonWriter
must not be null.
writer
)

Implements com.amazon.ion.SymbolTable.writeTo.

Writes an Ion representation of this symbol table.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DEFAULT_CAPACITYback to summary
private static final int DEFAULT_CAPACITY

The initial length of mySymbolNames.

DEFAULT_LST_FACTORYback to summary
pack-priv static final LocalSymbolTable.Factory DEFAULT_LST_FACTORY
isReadOnlyback to summary
private boolean isReadOnly

Whether this symbol table is read only, and thus, immutable.

myFirstLocalSidback to summary
pack-priv final int myFirstLocalSid

The sid of the first local symbol, which is stored at mySymbolNames[0].

myImportsListback to summary
private final LocalSymbolTableImports myImportsList

The system and shared symtabs imported by this symtab. Never null.

Note

this member field is immutable and assigned only during construction, hence no synchronization is needed for its method calls.

mySymbolNamesback to summary
pack-priv String[] mySymbolNames

The local symbol names declared in this symtab; never null. The sid of the first element is myFirstLocalSid. Only the first mySymbolsCount elements are valid.

mySymbolsCountback to summary
pack-priv int mySymbolsCount

This is the number of symbols defined in this symbol table locally, that is not imported from some other table.

mySymbolsMapback to summary
private final Map<String, Integer> mySymbolsMap

Map of symbol names to symbol ids of local symbols that are not in imports.

Constructor Detail

LocalSymbolTableback to summary
protected LocalSymbolTable(LocalSymbolTableImports imports, List<String> symbolsList)
Parameters
imports:LocalSymbolTableImports

never null

symbolsList:List<String>

may be null or empty

LocalSymbolTableback to summary
protected LocalSymbolTable(LocalSymbolTable other, int maxId)

Copy-constructor, performs defensive copying of member fields where necessary. The returned instance is mutable.

Method Detail

buildSymbolsMapback to summary
private void buildSymbolsMap()
findback to summary
public SymbolToken find(String text)

Implements com.amazon.ion.SymbolTable.find.

Doc from com.amazon.ion.SymbolTable.find.

Finds a symbol already interned by this table.

This method will not necessarily return the same instance given the same input.

Parameters
text:String

the symbol text to find.

Returns:SymbolToken

the interned symbol, with both text and SID defined; or null if it's not already interned.

findKnownSymbolback to summary
public String findKnownSymbol(int id)

Implements com.amazon.ion.SymbolTable.findKnownSymbol.

Doc from com.amazon.ion.SymbolTable.findKnownSymbol.

Gets the interned text for a symbol ID.

Parameters
id:int

the requested symbol ID.

Returns:String

the interned text associated with the symbol ID, or null if the text is not known.

findLocalSymbolback to summary
private int findLocalSymbol(String name)
findSymbolback to summary
public int findSymbol(String name)

Implements com.amazon.ion.SymbolTable.findSymbol.

Doc from com.amazon.ion.SymbolTable.findSymbol.

Gets the symbol ID associated with a given symbol name.

Parameters
name:String

must not be null or empty.

Returns:int

the id of the requested symbol, or UNKNOWN_SYMBOL_ID if it's not defined.

getImportedMaxIdback to summary
public int getImportedMaxId()

Implements com.amazon.ion.SymbolTable.getImportedMaxId.

Doc from com.amazon.ion.SymbolTable.getImportedMaxId.

Gets the highest symbol id reserved by this table's imports (including system symbols). Any id higher than this value is a local symbol declared by this table. This value is zero for shared symbol tables, since they do not utilize imports.

getImportedTablesback to summary
public SymbolTable[] getImportedTables()

Implements com.amazon.ion.SymbolTable.getImportedTables.

Doc from com.amazon.ion.SymbolTable.getImportedTables.

Gets the sequence of shared symbol tables imported by this (local) symbol table. The result does not include a system table.

If this local table imported a shared table for which the relevant IonCatalog has the same name but different version and/or max_id, then that entry will be a substitute table with the correct version and max_id, wrapping the original shared symbol table that was found.

If this local table imported a shared table for which the relevant IonCatalog has no entry with the same name, but the import declaration has a max_id available, then that entry will be a substitute table with max_id undefined symbols.

Returns:SymbolTable[]

null if this is a shared or system table, otherwise a non-null but potentially zero-length array of shared tables (but no system table).

getImportedTablesNoCopyback to summary
public SymbolTable[] getImportedTablesNoCopy()

Implements com.amazon.ion.impl._Private_LocalSymbolTable.getImportedTablesNoCopy.

Doc from com.amazon.ion.impl._Private_LocalSymbolTable.getImportedTablesNoCopy.

Returns the imported symbol tables without making a copy.

Note

Callers must not modify the resulting SymbolTable array! This will violate the immutability property of this class.

Returns:SymbolTable[]

the imported symtabs, as-is; the first element is a system symtab, the rest are non-system shared symtabs

Annotations
@Override
getIonVersionIdback to summary
public String getIonVersionId()

Implements com.amazon.ion.SymbolTable.getIonVersionId.

Doc from com.amazon.ion.SymbolTable.getIonVersionId.

Gets the identifier for the Ion version (and thus the system symbol table) used by this table. The version identifier is a string of the form "$ion_X_Y".

Returns:String

the version identifier; or null for non-system shared tables.

getMaxIdback to summary
public synchronized int getMaxId()

Implements com.amazon.ion.SymbolTable.getMaxId.

Doc from com.amazon.ion.SymbolTable.getMaxId.

Gets the highest symbol id reserved by this table.

Returns:int

the largest integer such that findKnownSymbol(int) could return a non-null result. Note that there is no promise that it will return a name, only that any larger id will not have a name defined.

getNameback to summary
public String getName()

Implements com.amazon.ion.SymbolTable.getName.

Doc from com.amazon.ion.SymbolTable.getName.

Gets the unique name of this symbol table.

Returns:String

the unique name, or null if isLocalTable().

getSystemSymbolTableback to summary
public SymbolTable getSystemSymbolTable()

Implements com.amazon.ion.SymbolTable.getSystemSymbolTable.

Doc from com.amazon.ion.SymbolTable.getSystemSymbolTable.

Gets the system symbol table being used by this local table.

If isSystemTable() then this method returns this. Otherwise, if isSharedTable() then this method returns null.

Returns:SymbolTable

not null, except for non-system shared tables.

getVersionback to summary
public int getVersion()

Implements com.amazon.ion.SymbolTable.getVersion.

Doc from com.amazon.ion.SymbolTable.getVersion.

Gets the version of this symbol table.

Returns:int

at least one, or zero if isLocalTable().

internback to summary
public synchronized SymbolToken intern(String text)

Implements com.amazon.ion.SymbolTable.intern.

Doc from com.amazon.ion.SymbolTable.intern.

Adds a new symbol to this table, or finds an existing definition of it.

The resulting SymbolToken has the same String instance that was first interned. In order to reduce memory footprint, callers should generally replace their copy of the text with the string in the result.

This method will not necessarily return the same instance given the same input.

Parameters
text:String

the symbol text to intern.

Returns:SymbolToken

the interned symbol, with both text and SID defined; not null.

isLocalTableback to summary
public boolean isLocalTable()

Implements com.amazon.ion.SymbolTable.isLocalTable.

Doc from com.amazon.ion.SymbolTable.isLocalTable.

Determines whether this symbol table is local, and therefore unnamed and unversioned.

If this method returns true, then both isSharedTable() and isSystemTable() will return false.

isReadOnlyback to summary
public synchronized boolean isReadOnly()

Implements com.amazon.ion.SymbolTable.isReadOnly.

Doc from com.amazon.ion.SymbolTable.isReadOnly.

Determines whether this symbol table can have symbols added to it. Shared symtabs are always read-only. Local symtabs can also be made read-only on demand, which enables some optimizations when writing data but will cause failures if new symbols are encountered.

Returns:boolean

true if this table is read-only, false if symbols may be added.

isSharedTableback to summary
public boolean isSharedTable()

Implements com.amazon.ion.SymbolTable.isSharedTable.

Doc from com.amazon.ion.SymbolTable.isSharedTable.

Determines whether this symbol table is shared, and therefore named, versioned, and read-only.

If this method returns true, then isLocalTable() will return false.

isSubstituteback to summary
public boolean isSubstitute()

Implements com.amazon.ion.SymbolTable.isSubstitute.

Doc from com.amazon.ion.SymbolTable.isSubstitute.

Determines whether this instance is substituting for an imported shared table for which no exact match was found in the catalog. Such tables are not authoritative and may not even have any symbol text at all (as is the case when no version of an imported table is found).

Substitute tables are always shared, non-system tables.

isSystemTableback to summary
public boolean isSystemTable()

Implements com.amazon.ion.SymbolTable.isSystemTable.

Doc from com.amazon.ion.SymbolTable.isSystemTable.

Determines whether this symbol table is a system symbol table, and therefore shared, named, versioned, and read-only.

If this method returns true, then isLocalTable() will return false and isSharedTable() will return true.

iterateDeclaredSymbolNamesback to summary
public synchronized Iterator<String> iterateDeclaredSymbolNames()

Implements com.amazon.ion.SymbolTable.iterateDeclaredSymbolNames.

Doc from com.amazon.ion.SymbolTable.iterateDeclaredSymbolNames.

Creates an iterator that will return all non-imported symbol names, in order of their symbol IDs. The iterator will return null where there is an undefined sid.

The first string returned by the iterator has a symbol ID that is one more than getImportedMaxId(), and the last string has symbol ID equals to getMaxId().

Returns:Iterator<String>

a new iterator.

makeCopyback to summary
public synchronized _Private_LocalSymbolTable makeCopy()

Implements com.amazon.ion.impl._Private_LocalSymbolTable.makeCopy.

Returns:_Private_LocalSymbolTable

Doc from com.amazon.ion.impl._Private_LocalSymbolTable.makeCopy.

a mutable copy of the symbol table.

Annotations
@Override
makeCopyback to summary
pack-priv synchronized LocalSymbolTable makeCopy(int maxId)
makeReadOnlyback to summary
public synchronized void makeReadOnly()

Implements com.amazon.ion.SymbolTable.makeReadOnly.

Doc from com.amazon.ion.SymbolTable.makeReadOnly.

Prevents this symbol table from accepting any more new symbols. Shared symtabs are always read-only. Making a local symtab read-only enables some optimizations when writing data, but will cause failures if new symbols are encountered.

prepImportsListback to summary
private static void prepImportsList(List<SymbolTable> importsList, IonReader reader, IonCatalog catalog)

Collects the necessary imports from the reader and catalog, and load them into the passed-in importsList.

putSymbolback to summary
pack-priv int putSymbol(String symbolName)

NOT SYNCHRONIZED! Call within constructor or from synch'd method.

putToMapIfNotThereback to summary
private static void putToMapIfNotThere(Map<String, Integer> symbolsMap, String text, int sid)
readLocalSymbolTableback to summary
protected static LocalSymbolTableImports readLocalSymbolTable(IonReader reader, IonCatalog catalog, boolean isOnStruct, List<String> symbolsListOut, SymbolTable currentSymbolTable)

Parses the symbol table at the reader's current position.

Parameters
reader:IonReader

the reader from which to parse the symbol table.

catalog:IonCatalog

the catalog from which to resolve shared symbol table imports.

isOnStruct:boolean

true if the reader is already positioned on the symbol table struct; otherwise, false.

symbolsListOut:List<String>

list into which local symbols declared by the parsed symbol table will be deposited.

currentSymbolTable:SymbolTable

the symbol table currently active in the stream.

Returns:LocalSymbolTableImports

a new LocalSymbolTableImports instance, or null if this was an LST append. If null, `currentSymbolTable` continues to be the active symbol table.

readOneImportback to summary
private static SymbolTable readOneImport(IonReader ionRep, IonCatalog catalog)

Returns a SymbolTable representation of a single import declaration from the passed-in reader and catalog.

Returns:SymbolTable

symbol table representation of the import; null if the import declaration is malformed

symtabExtendsback to summary
pack-priv boolean symtabExtends(SymbolTable other)

This method, and the context from which it is called, assumes that the symtabs are not being mutated by another thread. Therefore it doesn't use synchronization.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
unknownSymbolNameback to summary
public static String unknownSymbolName(int id)

Generate the string representation of a symbol with an unknown id.

Parameters
id:int

must be a value greater than zero.

Returns:String

the symbol name, of the form $NNN where NNN is the integer rendering of id

validateSymbolback to summary
private static final void validateSymbol(String name)
writeToback to summary
public void writeTo(IonWriter writer) throws IOException

Implements com.amazon.ion.SymbolTable.writeTo.

Doc from com.amazon.ion.SymbolTable.writeTo.

Writes an Ion representation of this symbol table.

Parameters
writer:IonWriter

must not be null.

Exceptions
IOException:
if thrown by the writer.
com.amazon.ion.impl back to summary

pack-priv Class LocalSymbolTable.Factory

extends Object
implements _Private_LocalSymbolTableFactory
Class Inheritance
All Implemented Interfaces
com.amazon.ion.impl._Private_LocalSymbolTableFactory

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public SymbolTable
newLocalSymtab(IonCatalog
the catalog containing shared symtabs referenced by import declarations within the local symtab
catalog
,
IonReader
the reader positioned on the local symbol table represented as a struct
reader
,
boolean
denotes whether the reader is already positioned on the struct; false if it is positioned before the struct
alreadyInStruct
)

Implements com.amazon.ion.impl._Private_LocalSymbolTableFactory.newLocalSymtab.

Constructs a new local symbol table represented by the current value of the passed in IonReader.

public SymbolTable
newLocalSymtab(SymbolTable
the default system symtab, which will be used if the first import in imports isn't a system symtab, never null
defaultSystemSymtab
,
SymbolTable...
the set of shared symbol tables to import; the first (and only the first) may be a system table, in which case the defaultSystemSymtab is ignored
imports
)

Implements com.amazon.ion.impl._Private_LocalSymbolTableFactory.newLocalSymtab.

Constructs a new local symtab with given imports and local symbols.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Factoryback to summary
private Factory()

Method Detail

newLocalSymtabback to summary
public SymbolTable newLocalSymtab(IonCatalog catalog, IonReader reader, boolean alreadyInStruct)

Implements com.amazon.ion.impl._Private_LocalSymbolTableFactory.newLocalSymtab.

Doc from com.amazon.ion.impl._Private_LocalSymbolTableFactory.newLocalSymtab.

Constructs a new local symbol table represented by the current value of the passed in IonReader.

Note

It is assumed that the passed in reader is positioned properly on/before a value that represents a local symtab semantically. That is, no exception-checks are made on the IonType and annotation, callers are responsible for checking this!

Parameters
catalog:IonCatalog

the catalog containing shared symtabs referenced by import declarations within the local symtab

reader:IonReader

the reader positioned on the local symbol table represented as a struct

alreadyInStruct:boolean

denotes whether the reader is already positioned on the struct; false if it is positioned before the struct

newLocalSymtabback to summary
public SymbolTable newLocalSymtab(SymbolTable defaultSystemSymtab, SymbolTable... imports)

Implements com.amazon.ion.impl._Private_LocalSymbolTableFactory.newLocalSymtab.

Doc from com.amazon.ion.impl._Private_LocalSymbolTableFactory.newLocalSymtab.

Constructs a new local symtab with given imports and local symbols.

Parameters
defaultSystemSymtab:SymbolTable

the default system symtab, which will be used if the first import in imports isn't a system symtab, never null

imports:SymbolTable[]

the set of shared symbol tables to import; the first (and only the first) may be a system table, in which case the defaultSystemSymtab is ignored

com.amazon.ion.impl back to summary

private final Class LocalSymbolTable.SymbolIterator

extends Object
implements Iterator<String>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private int
private final String[]
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
SymbolIterator(String[] symbolNames, int count)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public String
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_idxback to summary
private int _idx
mySymbolNamesback to summary
private final String[] mySymbolNames
mySymbolsCountback to summary
private final int mySymbolsCount

Constructor Detail

SymbolIteratorback to summary
pack-priv SymbolIterator(String[] symbolNames, int count)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

nextback to summary
public String next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:String

the next element in the iteration

removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.