public void clear() { ReportQueryResult.this.clear(); } }
public boolean contains(Object object) { return ReportQueryResult.this.containsKey(object); } public boolean remove(Object object) {
/** * PUBLIC: * Check if the value is contained in the result. */ public boolean contains(Object value) { return containsValue(value); }
@Override public int hashCode() { List<Object> results = getResults(); Object id = getId(); int result = results != null ? results.hashCode() : 0; result = 31 * result + (id != null ? id.hashCode() : 0); return result; }
/** * PUBLIC: * Return the value for given item name. */ public Object get(String name) { int index = getNames().indexOf(name); if (index == -1) { return null; } return getResults().get(index); }
ReportQueryResult reportQueryResult = new ReportQueryResult(this, row, toManyJoinData); if (this.returnedKeys.contains(reportQueryResult.getResultKey())){ return RESULT_IGNORED; //distinguish between null values and thrown away duplicates } else { this.returnedKeys.add(reportQueryResult.getResultKey()); return reportQueryResult.getResults().get(0); } else if (shouldReturnArray()) { return reportQueryResult.toArray(); } else if (shouldReturnWithoutReportQueryResult()) { if (reportQueryResult.size() == 1) { return reportQueryResult.getResults().get(0); } else { return reportQueryResult.toArray(); return reportQueryResult.getResults().get(0); } else { return reportQueryResult;
/** * INTERNAL: * Converts the ReportQueryResult to a simple list of values. */ public List toList(){ return this.getResults(); }
/** * PUBLIC: * Return the number of name/value pairs in the result. */ public int size() { return getNames().size(); }
/** * INTERNAL: * Used in testing to compare if results are correct. */ public boolean equals(ReportQueryResult result) { if (this == result) { return true; } if (!getResults().equals(result.getResults())) { return false; } // Compare PKs if (getPrimaryKeyValues() != null) { if (result.getPrimaryKeyValues() == null) { return false; } return Helper.compareOrderedVectors(getPrimaryKeyValues(), result.getPrimaryKeyValues()); } return true; }
/** * Get the value of the element at the specified * position in the result tuple. The first position is 0. * @param i position in result tuple * @return value of the result element * @throws IllegalArgumentException if i exceeds * length of result list */ public Object get(int i){ if (i<0 || (i >= this.rqr.getResults().size()) ) { throw new IllegalArgumentException(ExceptionLocalization.buildMessage( "jpa_criteriaapi_invalid_result_index", new Object[]{i, this.rqr.getResults().size()})); } return this.rqr.getByIndex(i); }
/** * PUBLIC: * Compare if the two results are equal. */ public boolean equals(Object anObject) { if (anObject instanceof ReportQueryResult) { return equals((ReportQueryResult)anObject); } return false; }
/** * PUBLIC: * Return the value for given item name. */ public Object get(Object name) { if (name instanceof String) { return get((String)name); } return null; }
public ReportQueryResult(ReportQuery query, AbstractRecord row, Vector toManyResults) { super(); this.names = query.getNames(); buildResult(query, row, toManyResults); }
/** * INTERNAL: * Construct a result from a row. Either return a ReportQueryResult or just the attribute. */ @Override public Object buildObject(AbstractRecord row, Vector toManyJoinData) { return new TupleImpl(this.selections, new ReportQueryResult(this, row, toManyJoinData)); } }
ReportQueryResult reportQueryResult = new ReportQueryResult(this, row, toManyJoinData); if (this.returnedKeys.contains(reportQueryResult.getResultKey())){ return RESULT_IGNORED; //distinguish between null values and thrown away duplicates } else { this.returnedKeys.add(reportQueryResult.getResultKey()); return reportQueryResult.getResults().get(0); } else if (shouldReturnArray()) { return reportQueryResult.toArray(); } else if (shouldReturnWithoutReportQueryResult()) { if (reportQueryResult.size() == 1) { return reportQueryResult.getResults().get(0); } else { return reportQueryResult.toArray(); return reportQueryResult.getResults().get(0); } else { return reportQueryResult;
/** * PUBLIC: * Return the value for given item name. */ public Object get(String name) { int index = getNames().indexOf(name); if (index == -1) { return null; } return getResults().get(index); }
/** * PUBLIC: * Returns an collection of the values. */ public Collection values() { return getResults(); } }
/** * PUBLIC: * Return if the result is empty. */ public boolean isEmpty() { return getNames().isEmpty(); }