private ArrayList<DefineCommand> getConstraintCommands() { if (constraintCommands == null) { constraintCommands = New.arrayList(); } return constraintCommands; }
/** * This constructor is used if the result set is later populated with * addRow. */ public SimpleResultSet() { rows = New.arrayList(); }
protected Function(Database database, FunctionInfo info) { this.database = database; this.info = info; if (info.parameterCount == VAR_ARGS) { varArgs = New.arrayList(); } else { args = new Expression[info.parameterCount]; } }
@Override public ArrayList<Parameter> getParameters() { return New.arrayList(); }
/** * Add a column to the natural join key column list. * * @param c the column to add */ public void addNaturalJoinColumn(Column c) { if (naturalJoinColumns == null) { naturalJoinColumns = New.arrayList(); } naturalJoinColumns.add(c); }
/** * Add a parameter to the parameter list. * * @param param the parameter to add */ void addParameter(Parameter param) { if (parameters == null) { parameters = New.arrayList(); } parameters.add(param); }
/** * Add the specified role to the list of roles. * * @param roleName the role */ public void addRoleName(String roleName) { if (roleNames == null) { roleNames = New.arrayList(); } roleNames.add(roleName); }
@Override public void addColumn(Column column) { if (columnsToAdd == null) { columnsToAdd = New.arrayList(); } columnsToAdd.add(column); }
private static <T> ArrayList<T> add(ArrayList<T> list, T obj) { if (list == null) { list = New.arrayList(); } // self constraints are two entries in the list list.add(obj); return list; }
ArrayList<InDoubtTransaction> getInDoubtTransactions() { ArrayList<InDoubtTransaction> list = New.arrayList(); for (SessionState state : sessionStates.values()) { PageStoreInDoubtTransaction in = state.inDoubtTransaction; if (in != null) { list.add(in); } } return list; }
public ArrayList<Table> getLocalTempTables() { if (localTempTables == null) { return New.arrayList(); } return new ArrayList<>(localTempTables.values()); }
public Table[] getLocks() { // copy the data without synchronizing ArrayList<Table> copy = New.arrayList(); for (Table lock : locks) { try { copy.add(lock); } catch (Exception e) { // ignore break; } } return copy.toArray(new Table[0]); }
private void resetSchema() { schema = New.arrayList(); objectIdSet = new HashSet<>(); tableMap = new HashMap<>(); columnTypeMap = new HashMap<>(); }
public RuleList(Rule first, Rule next, boolean or) { list = New.arrayList(); if (first instanceof RuleList && ((RuleList) first).or == or) { list.addAll(((RuleList) first).list); } else { list.add(first); } if (next instanceof RuleList && ((RuleList) next).or == or) { list.addAll(((RuleList) next).list); } else { list.add(next); } this.or = or; }
ArrayList<HashMap<String, Object>> getSessions() { ArrayList<HashMap<String, Object>> list = New.arrayList(); for (WebSession s : sessions.values()) { list.add(s.getInfo()); } return list; }
/** * Get all synonyms. * * @return all objects of that type */ public ArrayList<TableSynonym> getAllSynonyms() { ArrayList<TableSynonym> list = New.arrayList(); for (Schema schema : schemas.values()) { list.addAll(schema.getAllSynonyms()); } return list; }
@Override public List<FilePath> newDirectoryStream() { ArrayList<FilePath> list = New.arrayList(); synchronized (MEMORY_FILES) { for (String n : MEMORY_FILES.tailMap(name).keySet()) { if (n.startsWith(name)) { list.add(getPath(n)); } else { break; } } return list; } }
@Override public ArrayList<CacheObject> getAllChanged() { // if(Database.CHECK) { // testConsistency(); // } ArrayList<CacheObject> list = New.arrayList(); CacheObject rec = head.cacheNext; while (rec != head) { if (rec.isChanged()) { list.add(rec); } rec = rec.cacheNext; } return list; }
@Override public List<FilePath> newDirectoryStream() { ArrayList<FilePath> list = New.arrayList(); synchronized (MEMORY_FILES) { for (String n : MEMORY_FILES.tailMap(name).keySet()) { if (n.startsWith(name)) { if (!n.equals(name) && n.indexOf('/', name.length() + 1) < 0) { list.add(getPath(n)); } } else { break; } } return list; } }
/** * Get the tables with the given name, if any. * * @param name the table name * @return the list */ public ArrayList<Table> getTableOrViewByName(String name) { ArrayList<Table> list = New.arrayList(); for (Schema schema : schemas.values()) { Table table = schema.getTableOrViewByName(name); if (table != null) { list.add(table); } } return list; }