Collect all settings results from a Result

@param r Result
@return List of settings results
429630
public static List<SettingsResult> getSettingsResults(Result r) {
    if(r instanceof SettingsResult) {
      List<SettingsResult> ors = new ArrayList<>(1);
      ors.add((SettingsResult) r);
      return ors;
    }
    if(r instanceof HierarchicalResult) {
      return ResultUtil.filterResults(((HierarchicalResult) r).getHierarchy(), r, SettingsResult.class);
    }
    return Collections.emptyList();
  }
516627
public function settingsGetAll()
    {
        global $CFG;
        $name = $this->ENTITY_NAME;
        $retval = $this->ltiParameter($name."_settings", false);

        // Null means in the session - false means not in the session
        if ( $retval === null || ( is_string($retval) && strlen($retval) < 1 ) ) {
            $retval = array();
        } else if ( strlen($retval) > 0 ) {
            try {
                $retval = json_decode($retval, true);
            } catch(Exception $e) {
                $retval = array();
            }
        }
        // echo("Session $name: "); var_dump($retval);
        if ( is_array($retval) ) return $retval;

        $row = $this->launch->pdox->rowDie("SELECT settings FROM {$CFG->dbprefix}{$this->TABLE_NAME}
            WHERE {$name}_id = :ID",
            array(":ID" => $this->id));

        if ( $row === false ) return array();
        $json = $row['settings'];
        if ( $json === null ) return array();
        try {
            $retval = json_decode($json, true);
        } catch(Exception $e) {
            $retval = array();
        }

        // Put in session for quicker retrieval
        $this->ltiParameterUpdate($name."_settings", json_encode($retval));
        // echo("<hr>From DB\n");var_dump($retval);
        return $retval;
    }
1340223
public RRset []
answers() {
	if (type != SUCCESSFUL)
		return null;
	List l = (List) data;
	return (RRset []) l.toArray(new RRset[l.size()]);
}
165967
def list_settings(self):
        
        result = super().list_settings()
        result.append((self.SETTING_TREE_FORMATING, {}))
        result.append((self.SETTING_TREE_STYLE, 'utf8.a'))
        return result
138986
public void setResults(java.util.Collection<SearchRecord> results) {
        if (results == null) {
            this.results = null;
            return;
        }

        this.results = new java.util.ArrayList<SearchRecord>(results);
    }
628561
public static List<String> readToList(Reader r) throws IOException {
		try ( BufferedReader in = new BufferedReader(r) ) {
			List<String> l = new ArrayList<>();
			String line = null;
			while ((line = in.readLine()) != null)
				l.add(line);
			return Collections.unmodifiableList(l);
		}
	}
728285
function collectionResultList (context, results) {
    // apply views to each result
    return Promise.each(results, (raw, num) => {
        // get result
        return this.applyModelViewCollection(context, num, raw)
        // merge result to context
        .then(ctx => {
            _.merge(context, ctx)
        })
    })
    // resolve with context
    .then(() => context)
}
259274
public static List<Clustering<? extends Model>> getClusteringResults(Result r) {
    if(r instanceof Clustering<?>) {
      List<Clustering<?>> crs = new ArrayList<>(1);
      crs.add((Clustering<?>) r);
      return crs;
    }
    if(r instanceof HierarchicalResult) {
      return ResultUtil.filterResults(((HierarchicalResult) r).getHierarchy(), r, Clustering.class);
    }
    return Collections.emptyList();
  }
355721
public void getResult (ResultListener<T> rl)
    {
        if (_error != null) {
            rl.requestFailed(_error);
        } else if (_list == null) { // _list == null when we have a result
            rl.requestCompleted(_result);
        } else {
            _list.add(rl);
        }
    }
107432
private void formatResultSet(ResultSet r) {

        if (r == null) {
            String[] g = new String[1];

            g[0] = "Result";

            gResult.setHead(g);

            g[0] = "(empty)";

            gResult.addRow(g);

            return;
        }

        try {
            ResultSetMetaData m         = r.getMetaData();
            int               col       = m.getColumnCount();
            Object[]          h         = new Object[col];
            boolean[]         isVarChar = new boolean[col];

            for (int i = 1; i <= col; i++) {
                h[i - 1] = m.getColumnLabel(i);
                isVarChar[i - 1] = (m.getColumnType(i)
                                    == java.sql.Types.VARCHAR);
            }

            gResult.setHead(h);

            while (r.next()) {
                for (int i = 1; i <= col; i++) {
                    try {
                        h[i - 1] = r.getObject(i);

                        if (r.wasNull()) {
                            h[i - 1] = (isVarChar[i - 1] ? NULL_STR
                                                         : null);
                        }
                    } catch (SQLException e) {}
                }

                gResult.addRow(h);
            }

            r.close();
        } catch (SQLException e) {

            //  Added: (weconsultants@users)
            CommonSwing.errorMessage(e);
        }
    }
779057
private static Row row(List<StatementResult> results) {
		Row row = results.get( 0 ).getData().get( 0 );
		return row;
	}
1052344
public static Collection<SearchResultDTO> searchResultDTOs(SearchResults results) {
        return Lists.newArrayList(Iterables.transform(results, new Function<SearchResults.Result, SearchResultDTO>() {
            @Override
            public SearchResultDTO apply(Result input) {
                return new SearchResultDTO(
                        new ResourceDTO(input.getResource().getId(), unwrapMap(input.getResource().getAttributes())),
                        input.getMetrics());
            }
        }));
    }
1070599
private List iterateAndReturn(ResultSet rSet) {
        Iterator<Row> rowIter = rSet.iterator();
        List results = new ArrayList();

        while (rowIter.hasNext()) {
            Row row = rowIter.next();
            ColumnDefinitions columnDefs = row.getColumnDefinitions();
            Iterator<Definition> columnDefIter = columnDefs.iterator();
            Map rowData = new HashMap();
            while (columnDefIter.hasNext()) {
                Definition columnDef = columnDefIter.next();
                rowData.put(columnDef.getName(), DSClientUtilities.assign(row, null, null,
                    columnDef.getType().getName(), null, columnDef.getName(), null, null));
            }
            results.add(rowData);
        }
        return results;
    }
1282075
public List<String> getAllRHSVariables() {
        List<String> result = new ArrayList<String>();

        for (int i = 0; i < this.rhs.length; i++) {
            IAction pat = this.rhs[i];
            if (pat instanceof ActionInsertFact) {
                ActionInsertFact fact = (ActionInsertFact) pat;
                if (fact.isBound()) {
                    result.add(fact.getBoundName());
                }
            }
        }

        return result;
    }
470225
@SuppressWarnings("unchecked")
	public <P extends ParaObject> List<P> getItemsFromList(List<?> result) {
		if (result != null && !result.isEmpty()) {
			// this isn't very efficient but there's no way to know what type of objects we're reading
			ArrayList<P> objects = new ArrayList<>(result.size());
			for (Object map : result) {
				P p = ParaObjectUtils.setAnnotatedFields((Map<String, Object>) map);
				if (p != null) {
					objects.add(p);
				}
			}
			return objects;
		}
		return Collections.emptyList();
	}
712514
function formatResults (results) {
  return results.map(function (r) {
    return {
      fullName: r.fullName,
      hz: r.hz,
      hzDeviation: r.hzDeviation
    }
  })
}
1303501
public int filterObject(CaptureSearchResult r) {
		
		for(ObjectFilter<CaptureSearchResult> filter : filters) {
			if(filter == null) {
				return FILTER_EXCLUDE;
			}
			int result = filter.filterObject(r);
			if(result != FILTER_INCLUDE) {
				return result;
			}
		}
		return FILTER_INCLUDE;
	}