/*==========================================================================*\
| _SubmissionFileStats.java
|*-------------------------------------------------------------------------*|
| Created by eogenerator
| DO NOT EDIT. Make changes to SubmissionFileStats.java instead.
|*-------------------------------------------------------------------------*|
| Copyright (C) 2006-2012 Virginia Tech
|
| This file is part of Web-CAT.
|
| Web-CAT is free software; you can redistribute it and/or modify
| it under the terms of the GNU Affero General Public License as published
| by the Free Software Foundation; either version 3 of the License, or
| (at your option) any later version.
|
| Web-CAT is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
|
| You should have received a copy of the GNU Affero General Public License
| along with Web-CAT; if not, see <http://www.gnu.org/licenses/>.
\*==========================================================================*/
package org.webcat.grader;
import com.webobjects.eoaccess.*;
import com.webobjects.eocontrol.*;
import com.webobjects.foundation.*;
import er.extensions.eof.ERXEOControlUtilities;
import er.extensions.eof.ERXKey;
import org.apache.log4j.Logger;
import org.webcat.core.EOBasedKeyGenerator;
import org.webcat.woextensions.WCFetchSpecification;
// -------------------------------------------------------------------------
/**
* An automatically generated EOGenericRecord subclass. DO NOT EDIT.
* To change, use EOModeler, or make additions in
* SubmissionFileStats.java.
*
* @author Generated by eogenerator
* @version version suppressed to control auto-generation
*/
public abstract class _SubmissionFileStats
extends org.webcat.core.EOBase
{
//~ Constructors ..........................................................
// ----------------------------------------------------------
/**
* Creates a new _SubmissionFileStats object.
*/
public _SubmissionFileStats()
{
super();
}
// ----------------------------------------------------------
/**
* A static factory method for creating a new
* SubmissionFileStats object given required
* attributes and relationships.
* @param editingContext The context in which the new object will be
* inserted
* @return The newly created object
*/
public static SubmissionFileStats create(
EOEditingContext editingContext
)
{
SubmissionFileStats eoObject = (SubmissionFileStats)
EOUtilities.createAndInsertInstance(
editingContext,
_SubmissionFileStats.ENTITY_NAME);
return eoObject;
}
// ----------------------------------------------------------
/**
* Get a local instance of the given object in another editing context.
* @param editingContext The target editing context
* @param eo The object to import
* @return An instance of the given object in the target editing context
*/
public static SubmissionFileStats localInstance(
EOEditingContext editingContext, SubmissionFileStats eo)
{
return (eo == null)
? null
: (SubmissionFileStats)EOUtilities.localInstanceOfObject(
editingContext, eo);
}
// ----------------------------------------------------------
/**
* Look up an object by id number. Assumes the editing
* context is appropriately locked.
* @param ec The editing context to use
* @param id The id to look up
* @return The object, or null if no such id exists
*/
public static SubmissionFileStats forId(
EOEditingContext ec, int id)
{
SubmissionFileStats obj = null;
if (id > 0)
{
NSArray<SubmissionFileStats> objects =
objectsMatchingValues(ec, "id", new Integer(id));
if (objects != null && objects.count() > 0)
{
obj = objects.objectAtIndex(0);
}
}
return obj;
}
// ----------------------------------------------------------
/**
* Look up an object by id number. Assumes the editing
* context is appropriately locked.
* @param ec The editing context to use
* @param id The id to look up
* @return The object, or null if no such id exists
*/
public static SubmissionFileStats forId(
EOEditingContext ec, String id)
{
return forId(ec, er.extensions.foundation.ERXValueUtilities.intValue(id));
}
//~ Constants (for key names) .............................................
// Attributes ---
public static final String CLASS_NAME_KEY = "className";
public static final ERXKey<String> className =
new ERXKey<String>(CLASS_NAME_KEY);
public static final String CONDITIONALS_KEY = "conditionals";
public static final ERXKey<Integer> conditionals =
new ERXKey<Integer>(CONDITIONALS_KEY);
public static final String CONDITIONALS_COVERED_KEY = "conditionalsCovered";
public static final ERXKey<Integer> conditionalsCovered =
new ERXKey<Integer>(CONDITIONALS_COVERED_KEY);
public static final String DEDUCTIONS_KEY = "deductions";
public static final ERXKey<Double> deductions =
new ERXKey<Double>(DEDUCTIONS_KEY);
public static final String ELEMENTS_KEY = "elements";
public static final ERXKey<Integer> elements =
new ERXKey<Integer>(ELEMENTS_KEY);
public static final String ELEMENTS_COVERED_KEY = "elementsCovered";
public static final ERXKey<Integer> elementsCovered =
new ERXKey<Integer>(ELEMENTS_COVERED_KEY);
public static final String LOC_KEY = "loc";
public static final ERXKey<Integer> loc =
new ERXKey<Integer>(LOC_KEY);
public static final String MARKUP_FILE_NAME_RAW_KEY = "markupFileNameRaw";
public static final ERXKey<String> markupFileNameRaw =
new ERXKey<String>(MARKUP_FILE_NAME_RAW_KEY);
public static final String METHODS_KEY = "methods";
public static final ERXKey<Integer> methods =
new ERXKey<Integer>(METHODS_KEY);
public static final String METHODS_COVERED_KEY = "methodsCovered";
public static final ERXKey<Integer> methodsCovered =
new ERXKey<Integer>(METHODS_COVERED_KEY);
public static final String NCLOC_KEY = "ncloc";
public static final ERXKey<Integer> ncloc =
new ERXKey<Integer>(NCLOC_KEY);
public static final String PKG_NAME_KEY = "pkgName";
public static final ERXKey<String> pkgName =
new ERXKey<String>(PKG_NAME_KEY);
public static final String REMARKS_KEY = "remarks";
public static final ERXKey<Integer> remarks =
new ERXKey<Integer>(REMARKS_KEY);
public static final String SOURCE_FILE_NAME_RAW_KEY = "sourceFileNameRaw";
public static final ERXKey<String> sourceFileNameRaw =
new ERXKey<String>(SOURCE_FILE_NAME_RAW_KEY);
public static final String STATEMENTS_KEY = "statements";
public static final ERXKey<Integer> statements =
new ERXKey<Integer>(STATEMENTS_KEY);
public static final String STATEMENTS_COVERED_KEY = "statementsCovered";
public static final ERXKey<Integer> statementsCovered =
new ERXKey<Integer>(STATEMENTS_COVERED_KEY);
public static final String STATUS_KEY = "status";
public static final ERXKey<Integer> status =
new ERXKey<Integer>(STATUS_KEY);
public static final String TAGS_KEY = "tags";
public static final ERXKey<String> tags =
new ERXKey<String>(TAGS_KEY);
// To-one relationships ---
public static final String SUBMISSION_RESULT_KEY = "submissionResult";
public static final ERXKey<org.webcat.grader.SubmissionResult> submissionResult =
new ERXKey<org.webcat.grader.SubmissionResult>(SUBMISSION_RESULT_KEY);
// To-many relationships ---
public static final String COMMENTS_KEY = "comments";
public static final ERXKey<org.webcat.grader.SubmissionFileComment> comments =
new ERXKey<org.webcat.grader.SubmissionFileComment>(COMMENTS_KEY);
public static final String GRADER_PREFS_KEY = "graderPrefs";
public static final ERXKey<org.webcat.grader.GraderPrefs> graderPrefs =
new ERXKey<org.webcat.grader.GraderPrefs>(GRADER_PREFS_KEY);
// Fetch specifications ---
public static final String ENTITY_NAME = "SubmissionFileStats";
public transient final EOBasedKeyGenerator generateKey =
new EOBasedKeyGenerator(this);
//~ Methods ...............................................................
// ----------------------------------------------------------
/**
* Get a local instance of this object in another editing context.
* @param editingContext The target editing context
* @return An instance of this object in the target editing context
*/
public SubmissionFileStats localInstance(EOEditingContext editingContext)
{
return (SubmissionFileStats)EOUtilities.localInstanceOfObject(
editingContext, this);
}
// ----------------------------------------------------------
/**
* Get a list of changes between this object's current state and the
* last committed version.
* @return a dictionary of the changes that have not yet been committed
*/
@SuppressWarnings("unchecked")
public NSDictionary<String, Object> changedProperties()
{
return changesFromSnapshot(
editingContext().committedSnapshotForObject(this));
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>id</code> value.
* @return the value of the attribute
*/
public Number id()
{
try
{
return (Number)EOUtilities.primaryKeyForObject(
editingContext() , this).objectForKey("id");
}
catch (Exception e)
{
return er.extensions.eof.ERXConstant.ZeroInteger;
}
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>className</code> value.
* @return the value of the attribute
*/
public String className()
{
return (String)storedValueForKey( "className" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>className</code>
* property.
*
* @param value The new value for this property
*/
public void setClassName( String value )
{
if (log.isDebugEnabled())
{
log.debug( "setClassName("
+ value + "): was " + className() );
}
takeStoredValueForKey( value, "className" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>conditionals</code> value.
* @return the value of the attribute
*/
public int conditionals()
{
Integer returnValue =
(Integer)storedValueForKey( "conditionals" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>conditionals</code>
* property.
*
* @param value The new value for this property
*/
public void setConditionals( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setConditionals("
+ value + "): was " + conditionals() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setConditionalsRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>conditionals</code> value.
* @return the value of the attribute
*/
public Integer conditionalsRaw()
{
return (Integer)storedValueForKey( "conditionals" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>conditionals</code>
* property.
*
* @param value The new value for this property
*/
public void setConditionalsRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setConditionalsRaw("
+ value + "): was " + conditionalsRaw() );
}
takeStoredValueForKey( value, "conditionals" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>conditionalsCovered</code> value.
* @return the value of the attribute
*/
public int conditionalsCovered()
{
Integer returnValue =
(Integer)storedValueForKey( "conditionalsCovered" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>conditionalsCovered</code>
* property.
*
* @param value The new value for this property
*/
public void setConditionalsCovered( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setConditionalsCovered("
+ value + "): was " + conditionalsCovered() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setConditionalsCoveredRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>conditionalsCovered</code> value.
* @return the value of the attribute
*/
public Integer conditionalsCoveredRaw()
{
return (Integer)storedValueForKey( "conditionalsCovered" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>conditionalsCovered</code>
* property.
*
* @param value The new value for this property
*/
public void setConditionalsCoveredRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setConditionalsCoveredRaw("
+ value + "): was " + conditionalsCoveredRaw() );
}
takeStoredValueForKey( value, "conditionalsCovered" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>deductions</code> value.
* @return the value of the attribute
*/
public double deductions()
{
Double returnValue =
(Double)storedValueForKey( "deductions" );
return ( returnValue == null )
? 0.0
: returnValue.doubleValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>deductions</code>
* property.
*
* @param value The new value for this property
*/
public void setDeductions( double value )
{
if (log.isDebugEnabled())
{
log.debug( "setDeductions("
+ value + "): was " + deductions() );
}
Double actual =
new Double( value );
setDeductionsRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>deductions</code> value.
* @return the value of the attribute
*/
public Double deductionsRaw()
{
return (Double)storedValueForKey( "deductions" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>deductions</code>
* property.
*
* @param value The new value for this property
*/
public void setDeductionsRaw( Double value )
{
if (log.isDebugEnabled())
{
log.debug( "setDeductionsRaw("
+ value + "): was " + deductionsRaw() );
}
takeStoredValueForKey( value, "deductions" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>elements</code> value.
* @return the value of the attribute
*/
public int elements()
{
Integer returnValue =
(Integer)storedValueForKey( "elements" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>elements</code>
* property.
*
* @param value The new value for this property
*/
public void setElements( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setElements("
+ value + "): was " + elements() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setElementsRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>elements</code> value.
* @return the value of the attribute
*/
public Integer elementsRaw()
{
return (Integer)storedValueForKey( "elements" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>elements</code>
* property.
*
* @param value The new value for this property
*/
public void setElementsRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setElementsRaw("
+ value + "): was " + elementsRaw() );
}
takeStoredValueForKey( value, "elements" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>elementsCovered</code> value.
* @return the value of the attribute
*/
public int elementsCovered()
{
Integer returnValue =
(Integer)storedValueForKey( "elementsCovered" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>elementsCovered</code>
* property.
*
* @param value The new value for this property
*/
public void setElementsCovered( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setElementsCovered("
+ value + "): was " + elementsCovered() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setElementsCoveredRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>elementsCovered</code> value.
* @return the value of the attribute
*/
public Integer elementsCoveredRaw()
{
return (Integer)storedValueForKey( "elementsCovered" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>elementsCovered</code>
* property.
*
* @param value The new value for this property
*/
public void setElementsCoveredRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setElementsCoveredRaw("
+ value + "): was " + elementsCoveredRaw() );
}
takeStoredValueForKey( value, "elementsCovered" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>loc</code> value.
* @return the value of the attribute
*/
public int loc()
{
Integer returnValue =
(Integer)storedValueForKey( "loc" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>loc</code>
* property.
*
* @param value The new value for this property
*/
public void setLoc( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setLoc("
+ value + "): was " + loc() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setLocRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>loc</code> value.
* @return the value of the attribute
*/
public Integer locRaw()
{
return (Integer)storedValueForKey( "loc" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>loc</code>
* property.
*
* @param value The new value for this property
*/
public void setLocRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setLocRaw("
+ value + "): was " + locRaw() );
}
takeStoredValueForKey( value, "loc" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>markupFileNameRaw</code> value.
* @return the value of the attribute
*/
public String markupFileNameRaw()
{
return (String)storedValueForKey( "markupFileNameRaw" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>markupFileNameRaw</code>
* property.
*
* @param value The new value for this property
*/
public void setMarkupFileNameRaw( String value )
{
if (log.isDebugEnabled())
{
log.debug( "setMarkupFileNameRaw("
+ value + "): was " + markupFileNameRaw() );
}
takeStoredValueForKey( value, "markupFileNameRaw" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>methods</code> value.
* @return the value of the attribute
*/
public int methods()
{
Integer returnValue =
(Integer)storedValueForKey( "methods" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>methods</code>
* property.
*
* @param value The new value for this property
*/
public void setMethods( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setMethods("
+ value + "): was " + methods() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setMethodsRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>methods</code> value.
* @return the value of the attribute
*/
public Integer methodsRaw()
{
return (Integer)storedValueForKey( "methods" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>methods</code>
* property.
*
* @param value The new value for this property
*/
public void setMethodsRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setMethodsRaw("
+ value + "): was " + methodsRaw() );
}
takeStoredValueForKey( value, "methods" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>methodsCovered</code> value.
* @return the value of the attribute
*/
public int methodsCovered()
{
Integer returnValue =
(Integer)storedValueForKey( "methodsCovered" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>methodsCovered</code>
* property.
*
* @param value The new value for this property
*/
public void setMethodsCovered( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setMethodsCovered("
+ value + "): was " + methodsCovered() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setMethodsCoveredRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>methodsCovered</code> value.
* @return the value of the attribute
*/
public Integer methodsCoveredRaw()
{
return (Integer)storedValueForKey( "methodsCovered" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>methodsCovered</code>
* property.
*
* @param value The new value for this property
*/
public void setMethodsCoveredRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setMethodsCoveredRaw("
+ value + "): was " + methodsCoveredRaw() );
}
takeStoredValueForKey( value, "methodsCovered" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>ncloc</code> value.
* @return the value of the attribute
*/
public int ncloc()
{
Integer returnValue =
(Integer)storedValueForKey( "ncloc" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>ncloc</code>
* property.
*
* @param value The new value for this property
*/
public void setNcloc( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setNcloc("
+ value + "): was " + ncloc() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setNclocRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>ncloc</code> value.
* @return the value of the attribute
*/
public Integer nclocRaw()
{
return (Integer)storedValueForKey( "ncloc" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>ncloc</code>
* property.
*
* @param value The new value for this property
*/
public void setNclocRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setNclocRaw("
+ value + "): was " + nclocRaw() );
}
takeStoredValueForKey( value, "ncloc" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>pkgName</code> value.
* @return the value of the attribute
*/
public String pkgName()
{
return (String)storedValueForKey( "pkgName" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>pkgName</code>
* property.
*
* @param value The new value for this property
*/
public void setPkgName( String value )
{
if (log.isDebugEnabled())
{
log.debug( "setPkgName("
+ value + "): was " + pkgName() );
}
takeStoredValueForKey( value, "pkgName" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>remarks</code> value.
* @return the value of the attribute
*/
public int remarks()
{
Integer returnValue =
(Integer)storedValueForKey( "remarks" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>remarks</code>
* property.
*
* @param value The new value for this property
*/
public void setRemarks( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setRemarks("
+ value + "): was " + remarks() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setRemarksRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>remarks</code> value.
* @return the value of the attribute
*/
public Integer remarksRaw()
{
return (Integer)storedValueForKey( "remarks" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>remarks</code>
* property.
*
* @param value The new value for this property
*/
public void setRemarksRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setRemarksRaw("
+ value + "): was " + remarksRaw() );
}
takeStoredValueForKey( value, "remarks" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>sourceFileNameRaw</code> value.
* @return the value of the attribute
*/
public String sourceFileNameRaw()
{
return (String)storedValueForKey( "sourceFileNameRaw" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>sourceFileNameRaw</code>
* property.
*
* @param value The new value for this property
*/
public void setSourceFileNameRaw( String value )
{
if (log.isDebugEnabled())
{
log.debug( "setSourceFileNameRaw("
+ value + "): was " + sourceFileNameRaw() );
}
takeStoredValueForKey( value, "sourceFileNameRaw" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>statements</code> value.
* @return the value of the attribute
*/
public int statements()
{
Integer returnValue =
(Integer)storedValueForKey( "statements" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>statements</code>
* property.
*
* @param value The new value for this property
*/
public void setStatements( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setStatements("
+ value + "): was " + statements() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setStatementsRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>statements</code> value.
* @return the value of the attribute
*/
public Integer statementsRaw()
{
return (Integer)storedValueForKey( "statements" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>statements</code>
* property.
*
* @param value The new value for this property
*/
public void setStatementsRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setStatementsRaw("
+ value + "): was " + statementsRaw() );
}
takeStoredValueForKey( value, "statements" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>statementsCovered</code> value.
* @return the value of the attribute
*/
public int statementsCovered()
{
Integer returnValue =
(Integer)storedValueForKey( "statementsCovered" );
return ( returnValue == null )
? 0
: returnValue.intValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>statementsCovered</code>
* property.
*
* @param value The new value for this property
*/
public void setStatementsCovered( int value )
{
if (log.isDebugEnabled())
{
log.debug( "setStatementsCovered("
+ value + "): was " + statementsCovered() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setStatementsCoveredRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>statementsCovered</code> value.
* @return the value of the attribute
*/
public Integer statementsCoveredRaw()
{
return (Integer)storedValueForKey( "statementsCovered" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>statementsCovered</code>
* property.
*
* @param value The new value for this property
*/
public void setStatementsCoveredRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setStatementsCoveredRaw("
+ value + "): was " + statementsCoveredRaw() );
}
takeStoredValueForKey( value, "statementsCovered" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>status</code> value.
* @return the value of the attribute
*/
public byte status()
{
Integer returnValue =
(Integer)storedValueForKey( "status" );
return ( returnValue == null )
? org.webcat.core.Status.TO_DO
: returnValue.byteValue();
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>status</code>
* property.
*
* @param value The new value for this property
*/
public void setStatus( byte value )
{
if (log.isDebugEnabled())
{
log.debug( "setStatus("
+ value + "): was " + status() );
}
Integer actual =
er.extensions.eof.ERXConstant.integerForInt( value );
setStatusRaw( actual );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>status</code> value.
* @return the value of the attribute
*/
public Integer statusRaw()
{
return (Integer)storedValueForKey( "status" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>status</code>
* property.
*
* @param value The new value for this property
*/
public void setStatusRaw( Integer value )
{
if (log.isDebugEnabled())
{
log.debug( "setStatusRaw("
+ value + "): was " + statusRaw() );
}
takeStoredValueForKey( value, "status" );
}
// ----------------------------------------------------------
/**
* Retrieve this object's <code>tags</code> value.
* @return the value of the attribute
*/
public String tags()
{
return (String)storedValueForKey( "tags" );
}
// ----------------------------------------------------------
/**
* Change the value of this object's <code>tags</code>
* property.
*
* @param value The new value for this property
*/
public void setTags( String value )
{
if (log.isDebugEnabled())
{
log.debug( "setTags("
+ value + "): was " + tags() );
}
takeStoredValueForKey( value, "tags" );
}
// ----------------------------------------------------------
/**
* Retrieve the entity pointed to by the <code>submissionResult</code>
* relationship.
* @return the entity in the relationship
*/
public org.webcat.grader.SubmissionResult submissionResult()
{
return (org.webcat.grader.SubmissionResult)storedValueForKey( "submissionResult" );
}
// ----------------------------------------------------------
/**
* Set the entity pointed to by the <code>submissionResult</code>
* relationship (DO NOT USE--instead, use
* <code>setSubmissionResultRelationship()</code>.
* This method is provided for WebObjects use.
*
* @param value The new entity to relate to
*/
public void setSubmissionResult( org.webcat.grader.SubmissionResult value )
{
if (log.isDebugEnabled())
{
log.debug( "setSubmissionResult("
+ value + "): was " + submissionResult() );
}
takeStoredValueForKey( value, "submissionResult" );
}
// ----------------------------------------------------------
/**
* Set the entity pointed to by the <code>submissionResult</code>
* relationship. This method is a type-safe version of
* <code>addObjectToBothSidesOfRelationshipWithKey()</code>.
*
* @param value The new entity to relate to
*/
public void setSubmissionResultRelationship(
org.webcat.grader.SubmissionResult value )
{
if (log.isDebugEnabled())
{
log.debug( "setSubmissionResultRelationship("
+ value + "): was " + submissionResult() );
}
if ( value == null )
{
org.webcat.grader.SubmissionResult object = submissionResult();
if ( object != null )
removeObjectFromBothSidesOfRelationshipWithKey( object, "submissionResult" );
}
else
{
addObjectToBothSidesOfRelationshipWithKey( value, "submissionResult" );
}
}
// ----------------------------------------------------------
/**
* Retrieve the entities pointed to by the <code>comments</code>
* relationship.
* @return an NSArray of the entities in the relationship
*/
@SuppressWarnings("unchecked")
public NSArray<org.webcat.grader.SubmissionFileComment> comments()
{
return (NSArray)storedValueForKey( "comments" );
}
// ----------------------------------------------------------
/**
* Replace the list of entities pointed to by the
* <code>comments</code> relationship.
*
* @param value The new set of entities to relate to
*/
public void setComments( NSMutableArray<org.webcat.grader.SubmissionFileComment> value )
{
if (log.isDebugEnabled())
{
log.debug( "setComments("
+ value + "): was " + comments() );
}
takeStoredValueForKey( value, "comments" );
}
// ----------------------------------------------------------
/**
* Add a new entity to the <code>comments</code>
* relationship (DO NOT USE--instead, use
* <code>addToCommentsRelationship()</code>.
* This method is provided for WebObjects use.
*
* @param value The new entity to relate to
*/
public void addToComments( org.webcat.grader.SubmissionFileComment value )
{
if (log.isDebugEnabled())
{
log.debug( "addToComments("
+ value + "): was " + comments() );
}
NSMutableArray<org.webcat.grader.SubmissionFileComment> array =
(NSMutableArray<org.webcat.grader.SubmissionFileComment>)comments();
willChange();
array.addObject( value );
}
// ----------------------------------------------------------
/**
* Remove a specific entity from the <code>comments</code>
* relationship (DO NOT USE--instead, use
* <code>removeFromCommentsRelationship()</code>.
* This method is provided for WebObjects use.
*
* @param value The entity to remove from the relationship
*/
public void removeFromComments( org.webcat.grader.SubmissionFileComment value )
{
if (log.isDebugEnabled())
{
log.debug( "RemoveFromComments("
+ value + "): was " + comments() );
}
NSMutableArray<org.webcat.grader.SubmissionFileComment> array =
(NSMutableArray<org.webcat.grader.SubmissionFileComment>)comments();
willChange();
array.removeObject( value );
}
// ----------------------------------------------------------
/**
* Add a new entity to the <code>comments</code>
* relationship.
*
* @param value The new entity to relate to
*/
public void addToCommentsRelationship( org.webcat.grader.SubmissionFileComment value )
{
if (log.isDebugEnabled())
{
log.debug( "addToCommentsRelationship("
+ value + "): was " + comments() );
}
addObjectToBothSidesOfRelationshipWithKey(
value, "comments" );
}
// ----------------------------------------------------------
/**
* Remove a specific entity from the <code>comments</code>
* relationship.
*
* @param value The entity to remove from the relationship
*/
public void removeFromCommentsRelationship( org.webcat.grader.SubmissionFileComment value )
{
if (log.isDebugEnabled())
{
log.debug( "removeFromCommentsRelationship("
+ value + "): was " + comments() );
}
removeObjectFromBothSidesOfRelationshipWithKey(
value, "comments" );
}
// ----------------------------------------------------------
/**
* Create a brand new object that is a member of the
* <code>comments</code> relationship.
*
* @return The new entity
*/
public org.webcat.grader.SubmissionFileComment createCommentsRelationship()
{
if (log.isDebugEnabled())
{
log.debug( "createCommentsRelationship()" );
}
EOClassDescription eoClassDesc = EOClassDescription
.classDescriptionForEntityName( "SubmissionFileComment" );
EOEnterpriseObject eoObject = eoClassDesc
.createInstanceWithEditingContext( editingContext(), null );
editingContext().insertObject( eoObject );
addObjectToBothSidesOfRelationshipWithKey(
eoObject, "comments" );
return (org.webcat.grader.SubmissionFileComment)eoObject;
}
// ----------------------------------------------------------
/**
* Remove a specific entity that is a member of the
* <code>comments</code> relationship.
*
* @param value The entity to remove from the relationship
*/
public void deleteCommentsRelationship( org.webcat.grader.SubmissionFileComment value )
{
if (log.isDebugEnabled())
{
log.debug( "deleteCommentsRelationship("
+ value + "): was " + comments() );
}
removeObjectFromBothSidesOfRelationshipWithKey(
value, "comments" );
}
// ----------------------------------------------------------
/**
* Remove (and then delete, if owned) all entities that are members of the
* <code>comments</code> relationship.
*/
public void deleteAllCommentsRelationships()
{
if (log.isDebugEnabled())
{
log.debug( "deleteAllCommentsRelationships(): was "
+ comments() );
}
for (org.webcat.grader.SubmissionFileComment object : comments())
{
deleteCommentsRelationship(object);
}
}
// ----------------------------------------------------------
/**
* Retrieve the entities pointed to by the <code>graderPrefs</code>
* relationship.
* @return an NSArray of the entities in the relationship
*/
@SuppressWarnings("unchecked")
public NSArray<org.webcat.grader.GraderPrefs> graderPrefs()
{
return (NSArray)storedValueForKey( "graderPrefs" );
}
// ----------------------------------------------------------
/**
* Replace the list of entities pointed to by the
* <code>graderPrefs</code> relationship.
*
* @param value The new set of entities to relate to
*/
public void setGraderPrefs( NSMutableArray<org.webcat.grader.GraderPrefs> value )
{
if (log.isDebugEnabled())
{
log.debug( "setGraderPrefs("
+ value + "): was " + graderPrefs() );
}
takeStoredValueForKey( value, "graderPrefs" );
}
// ----------------------------------------------------------
/**
* Add a new entity to the <code>graderPrefs</code>
* relationship (DO NOT USE--instead, use
* <code>addToGraderPrefsRelationship()</code>.
* This method is provided for WebObjects use.
*
* @param value The new entity to relate to
*/
public void addToGraderPrefs( org.webcat.grader.GraderPrefs value )
{
if (log.isDebugEnabled())
{
log.debug( "addToGraderPrefs("
+ value + "): was " + graderPrefs() );
}
NSMutableArray<org.webcat.grader.GraderPrefs> array =
(NSMutableArray<org.webcat.grader.GraderPrefs>)graderPrefs();
willChange();
array.addObject( value );
}
// ----------------------------------------------------------
/**
* Remove a specific entity from the <code>graderPrefs</code>
* relationship (DO NOT USE--instead, use
* <code>removeFromGraderPrefsRelationship()</code>.
* This method is provided for WebObjects use.
*
* @param value The entity to remove from the relationship
*/
public void removeFromGraderPrefs( org.webcat.grader.GraderPrefs value )
{
if (log.isDebugEnabled())
{
log.debug( "RemoveFromGraderPrefs("
+ value + "): was " + graderPrefs() );
}
NSMutableArray<org.webcat.grader.GraderPrefs> array =
(NSMutableArray<org.webcat.grader.GraderPrefs>)graderPrefs();
willChange();
array.removeObject( value );
}
// ----------------------------------------------------------
/**
* Add a new entity to the <code>graderPrefs</code>
* relationship.
*
* @param value The new entity to relate to
*/
public void addToGraderPrefsRelationship( org.webcat.grader.GraderPrefs value )
{
if (log.isDebugEnabled())
{
log.debug( "addToGraderPrefsRelationship("
+ value + "): was " + graderPrefs() );
}
addObjectToBothSidesOfRelationshipWithKey(
value, "graderPrefs" );
}
// ----------------------------------------------------------
/**
* Remove a specific entity from the <code>graderPrefs</code>
* relationship.
*
* @param value The entity to remove from the relationship
*/
public void removeFromGraderPrefsRelationship( org.webcat.grader.GraderPrefs value )
{
if (log.isDebugEnabled())
{
log.debug( "removeFromGraderPrefsRelationship("
+ value + "): was " + graderPrefs() );
}
removeObjectFromBothSidesOfRelationshipWithKey(
value, "graderPrefs" );
}
// ----------------------------------------------------------
/**
* Create a brand new object that is a member of the
* <code>graderPrefs</code> relationship.
*
* @return The new entity
*/
public org.webcat.grader.GraderPrefs createGraderPrefsRelationship()
{
if (log.isDebugEnabled())
{
log.debug( "createGraderPrefsRelationship()" );
}
EOClassDescription eoClassDesc = EOClassDescription
.classDescriptionForEntityName( "GraderPrefs" );
EOEnterpriseObject eoObject = eoClassDesc
.createInstanceWithEditingContext( editingContext(), null );
editingContext().insertObject( eoObject );
addObjectToBothSidesOfRelationshipWithKey(
eoObject, "graderPrefs" );
return (org.webcat.grader.GraderPrefs)eoObject;
}
// ----------------------------------------------------------
/**
* Remove and then delete a specific entity that is a member of the
* <code>graderPrefs</code> relationship.
*
* @param value The entity to remove from the relationship and then delete
*/
public void deleteGraderPrefsRelationship( org.webcat.grader.GraderPrefs value )
{
if (log.isDebugEnabled())
{
log.debug( "deleteGraderPrefsRelationship("
+ value + "): was " + graderPrefs() );
}
removeObjectFromBothSidesOfRelationshipWithKey(
value, "graderPrefs" );
editingContext().deleteObject( value );
}
// ----------------------------------------------------------
/**
* Remove (and then delete, if owned) all entities that are members of the
* <code>graderPrefs</code> relationship.
*/
public void deleteAllGraderPrefsRelationships()
{
if (log.isDebugEnabled())
{
log.debug( "deleteAllGraderPrefsRelationships(): was "
+ graderPrefs() );
}
for (org.webcat.grader.GraderPrefs object : graderPrefs())
{
deleteGraderPrefsRelationship(object);
}
}
// ----------------------------------------------------------
/**
* Retrieve objects using a fetch specification.
*
* @param context The editing context to use
* @param fspec The fetch specification to use
*
* @return an NSArray of the entities retrieved
*/
@SuppressWarnings("unchecked")
public static NSArray<SubmissionFileStats> objectsWithFetchSpecification(
EOEditingContext context,
EOFetchSpecification fspec)
{
return context.objectsWithFetchSpecification(fspec);
}
// ----------------------------------------------------------
/**
* Retrieve all objects of this type.
*
* @param context The editing context to use
*
* @return an NSArray of the entities retrieved
*/
public static NSArray<SubmissionFileStats> allObjects(
EOEditingContext context)
{
return objectsMatchingQualifier(context, null, null);
}
// ----------------------------------------------------------
/**
* Retrieve objects using a qualifier.
*
* @param context The editing context to use
* @param qualifier The qualifier to use
*
* @return an NSArray of the entities retrieved
*/
public static NSArray<SubmissionFileStats> objectsMatchingQualifier(
EOEditingContext context,
EOQualifier qualifier)
{
return objectsMatchingQualifier(context, qualifier, null);
}
// ----------------------------------------------------------
/**
* Retrieve objects using a qualifier and sort orderings.
*
* @param context The editing context to use
* @param qualifier The qualifier to use
* @param sortOrderings The sort orderings to use
*
* @return an NSArray of the entities retrieved
*/
public static NSArray<SubmissionFileStats> objectsMatchingQualifier(
EOEditingContext context,
EOQualifier qualifier,
NSArray<EOSortOrdering> sortOrderings)
{
@SuppressWarnings("unchecked")
EOFetchSpecification fspec = new WCFetchSpecification(
ENTITY_NAME, qualifier, sortOrderings);
fspec.setUsesDistinct(true);
return objectsWithFetchSpecification(context, fspec);
}
// ----------------------------------------------------------
/**
* Retrieve the first object that matches a qualifier, when
* sorted with the specified sort orderings.
*
* @param context The editing context to use
* @param qualifier The qualifier to use
* @param sortOrderings the sort orderings
*
* @return the first entity that was retrieved, or null if there was none
*/
public static SubmissionFileStats firstObjectMatchingQualifier(
EOEditingContext context,
EOQualifier qualifier,
NSArray<EOSortOrdering> sortOrderings)
{
NSArray<SubmissionFileStats> objects =
objectsMatchingQualifier(context, qualifier, sortOrderings);
return (objects.size() > 0)
? objects.get(0)
: null;
}
// ----------------------------------------------------------
/**
* Retrieve a single object using a list of keys and values to match.
*
* @param context The editing context to use
* @param qualifier The qualifier to use
*
* @return the single entity that was retrieved
*
* @throws EOUtilities.MoreThanOneException
* if there is more than one matching object
*/
public static SubmissionFileStats uniqueObjectMatchingQualifier(
EOEditingContext context,
EOQualifier qualifier) throws EOUtilities.MoreThanOneException
{
NSArray<SubmissionFileStats> objects =
objectsMatchingQualifier(context, qualifier);
if (objects.size() > 1)
{
String msg = "fetching SubmissionFileStats";
try
{
if (qualifier != null)
{
msg += " where " + qualifier;
}
msg += ", result = " + objects;
}
catch (Exception e)
{
log.error("Exception building MoreThanOneException message, "
+ "contents so far: " + msg, e);
}
throw new EOUtilities.MoreThanOneException(msg);
}
return (objects.size() > 0)
? objects.get(0)
: null;
}
// ----------------------------------------------------------
/**
* Retrieve objects using a list of keys and values to match.
*
* @param context The editing context to use
* @param keysAndValues a list of keys and values to match, alternating
* "key", "value", "key", "value"...
*
* @return an NSArray of the entities retrieved
*/
public static NSArray<SubmissionFileStats> objectsMatchingValues(
EOEditingContext context,
Object... keysAndValues)
{
if (keysAndValues.length % 2 != 0)
{
throw new IllegalArgumentException("There should a value "
+ "corresponding to every key that was passed. Args = "
+ java.util.Arrays.toString(keysAndValues));
}
NSMutableDictionary<String, Object> valueDictionary =
new NSMutableDictionary<String, Object>();
for (int i = 0; i < keysAndValues.length; i += 2)
{
Object key = keysAndValues[i];
Object value = keysAndValues[i + 1];
if (key == null)
{
throw new IllegalArgumentException(
"Found null where a String key was expected, arguments = "
+ java.util.Arrays.toString(keysAndValues));
}
else if (!(key instanceof String))
{
throw new IllegalArgumentException(
"Found a " + key.getClass().getName() + " [" + key + "]"
+ " where a String key was expected, arguments = "
+ java.util.Arrays.toString(keysAndValues));
}
valueDictionary.setObjectForKey(value, key);
}
return objectsMatchingValues(context, valueDictionary);
}
// ----------------------------------------------------------
/**
* Retrieve objects using a dictionary of keys and values to match.
*
* @param context The editing context to use
* @param keysAndValues a dictionary of keys and values to match
*
* @return an NSArray of the entities retrieved
*/
@SuppressWarnings("unchecked")
public static NSArray<SubmissionFileStats> objectsMatchingValues(
EOEditingContext context,
NSDictionary<String, Object> keysAndValues)
{
return EOUtilities.objectsMatchingValues(context, ENTITY_NAME,
keysAndValues);
}
// ----------------------------------------------------------
/**
* Retrieve the first object that matches a set of keys and values, when
* sorted with the specified sort orderings.
*
* @param context The editing context to use
* @param sortOrderings the sort orderings
* @param keysAndValues a list of keys and values to match, alternating
* "key", "value", "key", "value"...
*
* @return the first entity that was retrieved, or null if there was none
*/
public static SubmissionFileStats firstObjectMatchingValues(
EOEditingContext context,
NSArray<EOSortOrdering> sortOrderings,
Object... keysAndValues)
{
if (keysAndValues.length % 2 != 0)
{
throw new IllegalArgumentException("There should a value "
+ "corresponding to every key that was passed. Args = "
+ java.util.Arrays.toString(keysAndValues));
}
NSMutableDictionary<String, Object> valueDictionary =
new NSMutableDictionary<String, Object>();
for (int i = 0; i < keysAndValues.length; i += 2)
{
Object key = keysAndValues[i];
Object value = keysAndValues[i + 1];
if (key == null)
{
throw new IllegalArgumentException(
"Found null where a String key was expected, arguments = "
+ java.util.Arrays.toString(keysAndValues));
}
else if (!(key instanceof String))
{
throw new IllegalArgumentException(
"Found a " + key.getClass().getName() + " [" + key + "]"
+ " where a String key was expected, arguments = "
+ java.util.Arrays.toString(keysAndValues));
}
valueDictionary.setObjectForKey(value, key);
}
return firstObjectMatchingValues(
context, sortOrderings, valueDictionary);
}
// ----------------------------------------------------------
/**
* Retrieves the first object that matches a set of keys and values, when
* sorted with the specified sort orderings.
*
* @param context The editing context to use
* @param sortOrderings the sort orderings
* @param keysAndValues a dictionary of keys and values to match
*
* @return the first entity that was retrieved, or null if there was none
*/
public static SubmissionFileStats firstObjectMatchingValues(
EOEditingContext context,
NSArray<EOSortOrdering> sortOrderings,
NSDictionary<String, Object> keysAndValues)
{
@SuppressWarnings("unchecked")
EOFetchSpecification fspec = new WCFetchSpecification(
ENTITY_NAME,
EOQualifier.qualifierToMatchAllValues(keysAndValues),
sortOrderings);
fspec.setFetchLimit(1);
NSArray<SubmissionFileStats> objects =
objectsWithFetchSpecification( context, fspec );
if ( objects.count() == 0 )
{
return null;
}
else
{
return objects.objectAtIndex(0);
}
}
// ----------------------------------------------------------
/**
* Retrieve a single object using a list of keys and values to match.
*
* @param context The editing context to use
* @param keysAndValues a list of keys and values to match, alternating
* "key", "value", "key", "value"...
*
* @return the single entity that was retrieved, or null if there was none
*
* @throws EOUtilities.MoreThanOneException
* if there is more than one matching object
*/
public static SubmissionFileStats uniqueObjectMatchingValues(
EOEditingContext context,
Object... keysAndValues) throws EOUtilities.MoreThanOneException
{
if (keysAndValues.length % 2 != 0)
{
throw new IllegalArgumentException("There should a value "
+ "corresponding to every key that was passed. Args = "
+ java.util.Arrays.toString(keysAndValues));
}
NSMutableDictionary<String, Object> valueDictionary =
new NSMutableDictionary<String, Object>();
for (int i = 0; i < keysAndValues.length; i += 2)
{
Object key = keysAndValues[i];
Object value = keysAndValues[i + 1];
if (key == null)
{
throw new IllegalArgumentException(
"Found null where a String key was expected, arguments = "
+ java.util.Arrays.toString(keysAndValues));
}
else if (!(key instanceof String))
{
throw new IllegalArgumentException(
"Found a " + key.getClass().getName() + " [" + key + "]"
+ " where a String key was expected, arguments = "
+ java.util.Arrays.toString(keysAndValues));
}
valueDictionary.setObjectForKey(value, key);
}
return uniqueObjectMatchingValues(context, valueDictionary);
}
// ----------------------------------------------------------
/**
* Retrieve an object using a dictionary of keys and values to match.
*
* @param context The editing context to use
* @param keysAndValues a dictionary of keys and values to match
*
* @return the single entity that was retrieved, or null if there was none
*
* @throws EOUtilities.MoreThanOneException
* if there is more than one matching object
*/
public static SubmissionFileStats uniqueObjectMatchingValues(
EOEditingContext context,
NSDictionary<String, Object> keysAndValues)
throws EOUtilities.MoreThanOneException
{
try
{
return (SubmissionFileStats)EOUtilities.objectMatchingValues(
context, ENTITY_NAME, keysAndValues);
}
catch (EOObjectNotAvailableException e)
{
return null;
}
}
// ----------------------------------------------------------
/**
* Retrieve the count of all objects of this type.
*
* @param context The editing context to use
*
* @return the count of all objects
*/
public static int countOfAllObjects(EOEditingContext context)
{
return countOfObjectsMatchingQualifier(context, null);
}
// ----------------------------------------------------------
/**
* Retrieve the count of objects that match a qualifier.
*
* @param context The editing context to use
* @param qualifier The qualifier to use
*
* @return the count of objects matching the qualifier
*/
public static int countOfObjectsMatchingQualifier(
EOEditingContext context, EOQualifier qualifier)
{
return ERXEOControlUtilities.objectCountWithQualifier(
context, ENTITY_NAME, qualifier);
}
// ----------------------------------------------------------
/**
* Retrieve the count of objects using a list of keys and values to match.
*
* @param context The editing context to use
* @param keysAndValues a list of keys and values to match, alternating
* "key", "value", "key", "value"...
*
* @return the count of objects that match the specified values
*/
public static int countOfObjectsMatchingValues(
EOEditingContext context,
Object... keysAndValues)
{
if (keysAndValues.length % 2 != 0)
{
throw new IllegalArgumentException("There should a value "
+ "corresponding to every key that was passed. Args = "
+ java.util.Arrays.toString(keysAndValues));
}
NSMutableDictionary<String, Object> valueDictionary =
new NSMutableDictionary<String, Object>();
for (int i = 0; i < keysAndValues.length; i += 2)
{
Object key = keysAndValues[i];
Object value = keysAndValues[i + 1];
if (key == null)
{
throw new IllegalArgumentException(
"Found null where a String key was expected, arguments = "
+ java.util.Arrays.toString(keysAndValues));
}
else if (!(key instanceof String))
{
throw new IllegalArgumentException(
"Found a " + key.getClass().getName() + " [" + key + "]"
+ " where a String key was expected, arguments = "
+ java.util.Arrays.toString(keysAndValues));
}
valueDictionary.setObjectForKey(value, key);
}
return countOfObjectsMatchingValues(context, valueDictionary);
}
// ----------------------------------------------------------
/**
* Retrieve the count of objects using a dictionary of keys and values to
* match.
*
* @param context The editing context to use
* @param keysAndValues a dictionary of keys and values to match
*
* @return the count of objects that matched the specified values
*/
public static int countOfObjectsMatchingValues(
EOEditingContext context,
NSDictionary<String, Object> keysAndValues)
{
return countOfObjectsMatchingQualifier(context,
EOQualifier.qualifierToMatchAllValues(keysAndValues));
}
// ----------------------------------------------------------
/**
* Produce a string representation of this object. This implementation
* calls UserPresentableDescription(), which uses WebObjects' internal
* mechanism to print out the visible fields of this object. Normally,
* subclasses would override userPresentableDescription() to change
* the way the object is printed.
*
* @return A string representation of the object's value
*/
public String toString()
{
return userPresentableDescription();
}
//~ Instance/static variables .............................................
static Logger log = Logger.getLogger(SubmissionFileStats.class);
}