public TileMatrixSet getTileMatrixSet ( ) { TileMatrixSet result = null ; if ( tileMatrixSet . size ( ) > 1 ) { // This shouldn't happen with the table name primary key on tile // matrix set throw new GeoPackageException ( "Unexpected state. More than one TileMatrixSet has a foreign key to the Contents. Count: " + tileMatrixSet . size ( ) ) ; } else if ( tileMatrixSet . size ( ) == 1 ) { CloseableIterator < TileMatrixSet > iterator = tileMatrixSet . closeableIterator ( ) ; try { result = iterator . next ( ) ; } finally { try { iterator . close ( ) ; } catch ( IOException e ) { throw new GeoPackageException ( "Failed to close the Tile Matrix Set iterator" , e ) ; } } } return result ; }
Get the Tile Matrix Set should only return one or no value