Tried to make the import mess a little better. Fixed a lot of bugs. Changed some class names in the test cases. Looks like all the tests are being run in the same space. Has to look into this…..

This commit is contained in:
Martin Carlberg
2012-12-17 00:40:26 +01:00
parent 0280a10832
commit b52217e8a0
47 changed files with 4881 additions and 4778 deletions
+1 -1
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPObject.j>
@import <Foundation/CPKeyValueObserving.j>
@import <Foundation/CPIndexSet.j>
+1 -1
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPData.j>
@import <Foundation/CPIndexSet.j>
@import <Foundation/CPKeyedArchiver.j>
+1 -1
View File
@@ -21,7 +21,7 @@
*/
@import <Foundation/CPString.j>
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import "CPApplication.j"
@import "CPResponder.j"
+1 -1
View File
@@ -24,7 +24,7 @@
*/
@import <Foundation/CPObject.j>
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPDictionary.j>
@import <Foundation/CPValueTransformer.j>
+1 -1
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPDictionary.j>
@import <Foundation/CPNotificationCenter.j>
@import <Foundation/CPString.j>
+1 -1
View File
@@ -21,7 +21,7 @@
*/
@import <Foundation/CPObject.j>
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPDictionary.j>
@import <Foundation/CPPropertyListSerialization.j>
+1 -1
View File
@@ -21,7 +21,7 @@
*/
@import <Foundation/CPPredicate.j>
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPDictionary.j>
@import <Foundation/CPIndexSet.j>
@import "CPTextField.j"
+1 -1
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import "CPControl.j"
+1 -1
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPIndexSet.j>
@import "CGGradient.j"
+1 -1
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPGeometry.j>
@import <Foundation/CPObjJRuntime.j>
@import <Foundation/CPSet.j>
+1 -1
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import "CPApplication.j"
@import "CPCib.j"
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPObject.j>
@import <Foundation/CPString.j>
+1 -1
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPObject.j>
+1 -1
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "_CPJavaScriptArray.j"
@import "CPArray.j"
@import "CPNull.j"
@import "_CPCollectionKVCOperators.j"
Executable → Regular
+2 -996
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,5 +1,5 @@
@import "CPArray.j"
@import "_CPArray.j"
/*!
+1018
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "_CPJavaScriptArray.j"
@import "CPArray.j"
@import "CPEnumerator.j"
@import "CPException.j"
@import "CPNull.j"
@@ -646,7 +646,7 @@
for (; index < count; ++index)
{
var key = keys[index],
value = valueForKey(key);
value = self.valueForKey(key);
string += "\t" + key + ": " + CPDescriptionOfObject(value).split('\n').join("\n\t") + ",\n";
}
@@ -670,7 +670,7 @@
for (var index = 0; index < count; index++)
{
var key = keys[index],
value = valueForKey(key);
value = self.valueForKey(key);
aFunction(key, value, shouldStopRef);
+9 -376
View File
@@ -19,379 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPArray.j"
@import "CPDictionary.j"
@import "CPKeyValueCoding.j"
@import "CPObject.j"
@import "CPString.j"
/*!
An expression that always returns the same value.
*/
CPConstantValueExpressionType = 0;
/*!
An expression that always returns the parameter object itself.
*/
CPEvaluatedObjectExpressionType = 1;
/*!
An expression that always returns whatever value is associated with the key specified by ‘variable’ in the bindings dictionary.
*/
CPVariableExpressionType = 2;
/*!
An expression that returns something that can be used as a key path.
*/
CPKeyPathExpressionType = 3;
/*!
An expression that returns the result of evaluating a function.
*/
CPFunctionExpressionType = 4;
/*!
An expression that defines an aggregate of CPExpression objects.
*/
CPAggregateExpressionType = 5;
/*!
An expression that filters a collection using a subpredicate.
*/
CPSubqueryExpressionType = 6;
/*!
An expression that creates a union of the results of two nested expressions.
*/
CPUnionSetExpressionType = 7;
/*!
An expression that creates an intersection of the results of two nested expressions.
*/
CPIntersectSetExpressionType = 8;
/*!
An expression that combines two nested expression results by set subtraction.
*/
CPMinusSetExpressionType = 9;
/*!
@ingroup foundation
@class CPExpression
@brief CPExpression is used to represent expressions in a predicate.
Comparison operations in an CPPredicate are based on two expressions, as represented by instances of the CPExpression class.
Expressions are created for constant values, key paths, and so on.
Generally, anywhere in the CPExpression class hierarchy where there is composite API and subtypes
that may only reasonably respond to a subset of that API, invoking a method that does not make sense
for that subtype will cause an exception to be thrown.
*/
@implementation CPExpression : CPObject
{
int _type;
}
// Initializing an Expression
/*!
Initializes the receiver with the specified expression type.
@param type The type of the new expression, as defined by CPExpressionType.
@return An initialized CPExpression object of the type type.
*/
- (id)initWithExpressionType:(int)type
{
_type = type;
return self;
}
//Creating an Expression for a Value
/*!
Returns a new expression that represents a given constant value.
@param value The constant value the new expression is to represent.
@return A new expression that represents the constant value.
*/
+ (CPExpression)expressionForConstantValue:(id)value
{
return [[_CPConstantValueExpression alloc] initWithValue:value];
}
/*!
Returns a new expression that represents the object being evaluated.
@return A new expression that represents the object being evaluated.
*/
+ (CPExpression)expressionForEvaluatedObject
{
return [_CPSelfExpression evaluatedObject];
}
/*!
Returns a new expression that extracts a value from the variable bindings dictionary for a given key.
@param string The key for the variable to extract from the variable bindings dictionary.
@return A new expression that extracts from the variable bindings dictionary the value for the key string.
*/
+ (CPExpression)expressionForVariable:(CPString)string
{
return [[_CPVariableExpression alloc] initWithVariable:string];
}
/*!
Returns a new expression that invokes valueForKeyPath: with a given key path.
@param keyPath The key path that the new expression should evaluate.
@return A new expression that invokes valueForKeyPath: with keyPath.
*/
+ (CPExpression)expressionForKeyPath:(CPString)keyPath
{
return [[_CPKeyPathExpression alloc] initWithKeyPath:keyPath];
}
/*!
Returns a new aggregate expression for a given collection.
@param collection A collection object (an instance of CPArray, CPSet, or CPDictionary) that contains further expressions.
@return A new expression that contains the expressions in collection.
*/
+ (CPExpression)expressionForAggregate:(CPArray)collection
{
return [[_CPAggregateExpression alloc] initWithAggregate:collection];
}
/*!
Returns a new CPExpression object that represent the union of a given set and collection.
@param left An expression that evaluates to a CPSet object.
@param right An expression that evaluates to a collection object (an instance of CPArray, CPSet, or CPDictionary).
@return A new CPExpression object that represents the union of left and right.
*/
+ (CPExpression)expressionForUnionSet:(CPExpression)left with:(CPExpression)right
{
return [[_CPSetExpression alloc] initWithType:CPUnionSetExpressionType left:left right:right];
}
/*!
Returns a new CPExpression object that represent the intersection of a given set and collection.
@param left An expression that evaluates to a CPSet object.
@param right An expression that evaluates to a collection object (an instance of CPArray, CPSet, or CPDictionary).
@return A new CPExpression object that represents the intersection of left and right.
*/
+ (CPExpression)expressionForIntersectSet:(CPExpression)left with:(CPExpression)right
{
return [[_CPSetExpression alloc] initWithType:CPIntersectSetExpressionType left:left right:right];
}
/*!
Returns a new CPExpression object that represent the subtraction of a given collection from a given set.
@param left An expression that evaluates to a CPSet object.
@param left An expression that evaluates to a collection object (an instance of CPArray, CPSet, or CPDictionary).
@return A new CPExpression object that represents the subtraction of right from left.
*/
+ (CPExpression)expressionForMinusSet:(CPExpression)left with:(CPExpression)right
{
return [[_CPSetExpression alloc] initWithType:CPMinusSetExpressionType left:left right:right];
}
// Creating an Expression for a Function
/*!
Returns a new expression that will invoke one of the predefined functions.
@param function_name The name of the function to invoke.
@param parameters An array containing CPExpression objects that will be used as parameters during the invocation of selector.
@return A new expression that invokes the function name using the parameters in parameters.
For a selector taking no parameters, the array should be empty. For a selector taking one or more parameters,
the array should contain one CPExpression object which will evaluate to an instance of the appropriate type for each parameter.
If there is a mismatch between the number of parameters expected and the number you provide during evaluation,
an exception may be raised or missing parameters may simply be replaced by nil (which occurs depends on how many
parameters are provided, and whether you have over- or underflow).
The name parameter can be one of the following predefined functions:
@verbatim
name parameter array contents returns
-------------------------------------------------------------------------------------------------------------------------------------
sum: CPExpression instances representing numbers CPNumber
count: CPExpression instances representing numbers CPNumber
min: CPExpression instances representing numbers CPNumber
max: CPExpression instances representing numbers CPNumber
average: CPExpression instances representing numbers CPNumber
median: CPExpression instances representing numbers CPNumber
mode: CPExpression instances representing numbers CPArray (returned array will contain all occurrences of the mode)
stddev: CPExpression instances representing numbers CPNumber
add:to: CPExpression instances representing numbers CPNumber
from:subtract: two CPExpression instances representing numbers CPNumber
multiply:by: two CPExpression instances representing numbers CPNumber
divide:by: two CPExpression instances representing numbers CPNumber
modulus:by: two CPExpression instances representing numbers CPNumber
sqrt: one CPExpression instance representing numbers CPNumber
log: one CPExpression instance representing a number CPNumber
ln: one CPExpression instance representing a number CPNumber
raise:toPower: one CPExpression instance representing a number CPNumber
exp: one CPExpression instance representing a number CPNumber
floor: one CPExpression instance representing a number CPNumber
ceiling: one CPExpression instance representing a number CPNumber
abs: one CPExpression instance representing a number CPNumber
trunc: one CPExpression instance representing a number CPNumber
uppercase: one CPExpression instance representing a string CPString
lowercase: one CPExpression instance representing a string CPString
random: one CPExpression instance representing a number CPNumber (integer) such that 0 <= rand < param
now: none [CPDate now]
This method raises an exception immediately if the selector is invalid; it raises an exception at runtime if the parameters are incorrect.
@endverbatim
*/
+ (CPExpression)expressionForFunction:(CPString)function_name arguments:(CPArray)parameters
{
return [[_CPFunctionExpression alloc] initWithSelector:CPSelectorFromString(function_name) arguments:parameters];
}
/*!
Returns an expression which will return the result of invoking on a given target a selector with a given name using given arguments.
@param target A CPExpression object which will evaluate an object on which the selector identified by name may be invoked.
@param selectorName The name of the method to be invoked.
@param parameters An array containing CPExpression objects which can be evaluated to provide parameters for the method specified by name.
@return An expression which will return the result of invoking the selector named name on the result of evaluating the target expression with the parameters specified by evaluating the elements of parameters.
See the description of \c expressionForFunction:arguments: for examples of how to construct the parameter array.
*/
+ (CPExpression)expressionForFunction:(CPExpression)target selectorName:(CPString)selectorName arguments:(CPArray)parameters
{
return [[_CPFunctionExpression alloc] initWithTarget:target selector:CPSelectorFromString(selectorName) arguments:parameters];
}
/*!
Returns an expression that filters a collection by storing elements in the collection in a given variable and keeping the elements for which qualifier returns true.
@param expression A CPExpression that evaluates to a collection.
@param variable Used as a local variable, and will shadow any instances of variable in the bindings dictionary. The variable is removed or the old value replaced once evaluation completes.
@param predicate The predicate used to determine whether the element belongs in the result collection.
@return An expression that filters a collection by storing elements in the collection in the variable variable and keeping the elements for which qualifier returns true.
*/
+ (CPExpression)expressionForSubquery:(CPExpression)expression usingIteratorVariable:(CPString)variable predicate:(CPPredicate)predicate
{
return [[_CPSubqueryExpression alloc] initWithExpression:expression usingIteratorVariable:variable predicate:predicate];
}
// Getting Information About an Expression
/*!
Returns the expression type for the receiver.
@return The expression type for the receiver.
This method raises an exception if it is not applicable to the receiver.
*/
- (int)expressionType
{
return _type;
}
/*!
Returns the constant value of the receiver.
@return The constant value of the receiver.
This method raises an exception if it is not applicable to the receiver.
*/
- (id)constantValue
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the variable for the receiver.
@return The variable for the receiver.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPString)variable
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the key path for the receiver.
@return The key path for the receiver.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPString)keyPath
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the function for the receiver.
@return The function for the receiver.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPString)function
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the arguments for the receiver.
@return The arguments for the receiver—that is, the array of expressions that will be passed as parameters during invocation of the selector on the operand of a function expression.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPArray)arguments
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the collection of expressions in an aggregate expression, or the collection element of a subquery expression.
@return The collection of expressions in an aggregate expression, or the collection element of a subquery expression.
This method raises an exception if it is not applicable to the receiver.
*/
- (id)collection
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the predicate in a subquery expression.
@return The predicate in a subquery expression..
This method raises an exception if it is not applicable to the receiver.
*/
- (CPPredicate)predicate
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the operand for the receiver.
@return The operand for the receiver—that is, the object on which the selector will be invoked.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPExpression)operand
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the left expression of a set expression.
@return The left expression of a set expression.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPExpression)leftExpression
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the right expression of a set expression.
@return The right expression of a set expression.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPExpression)rightExpression
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
- (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)variables
{
return self;
}
@end
//@import "_CPConstantValueExpression.j"
//@import "_CPSelfExpression.j"
//@import "_CPVariableExpression.j"
//@import "_CPKeyPathExpression.j"
//@import "_CPFunctionExpression.j"
//@import "_CPAggregateExpression.j"
//@import "_CPSetExpression.j"
//@import "_CPSubqueryExpression.j"
@import "_CPExpression.j"
@import "_CPConstantValueExpression.j"
@import "_CPSelfExpression.j"
@import "_CPVariableExpression.j"
@import "_CPKeyPathExpression.j"
@import "_CPFunctionExpression.j"
@import "_CPAggregateExpression.j"
@import "_CPSetExpression.j"
@import "_CPSubqueryExpression.j"
+1 -1
View File
@@ -225,7 +225,7 @@
while (count--)
{
if (![predicate evaluateWithObject:[self objectAtIndex:count]])
splice(count, 1);
self.splice(count, 1);
}
}
+397
View File
@@ -0,0 +1,397 @@
/*
* CPExpression.j
*
* Created by cacaodev.
* Copyright 2010.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPArray.j"
@import "CPDictionary.j"
@import "CPKeyValueCoding.j"
@import "CPObject.j"
@import "CPString.j"
/*!
An expression that always returns the same value.
*/
CPConstantValueExpressionType = 0;
/*!
An expression that always returns the parameter object itself.
*/
CPEvaluatedObjectExpressionType = 1;
/*!
An expression that always returns whatever value is associated with the key specified by ‘variable’ in the bindings dictionary.
*/
CPVariableExpressionType = 2;
/*!
An expression that returns something that can be used as a key path.
*/
CPKeyPathExpressionType = 3;
/*!
An expression that returns the result of evaluating a function.
*/
CPFunctionExpressionType = 4;
/*!
An expression that defines an aggregate of CPExpression objects.
*/
CPAggregateExpressionType = 5;
/*!
An expression that filters a collection using a subpredicate.
*/
CPSubqueryExpressionType = 6;
/*!
An expression that creates a union of the results of two nested expressions.
*/
CPUnionSetExpressionType = 7;
/*!
An expression that creates an intersection of the results of two nested expressions.
*/
CPIntersectSetExpressionType = 8;
/*!
An expression that combines two nested expression results by set subtraction.
*/
CPMinusSetExpressionType = 9;
/*!
@ingroup foundation
@class CPExpression
@brief CPExpression is used to represent expressions in a predicate.
Comparison operations in an CPPredicate are based on two expressions, as represented by instances of the CPExpression class.
Expressions are created for constant values, key paths, and so on.
Generally, anywhere in the CPExpression class hierarchy where there is composite API and subtypes
that may only reasonably respond to a subset of that API, invoking a method that does not make sense
for that subtype will cause an exception to be thrown.
*/
@implementation CPExpression : CPObject
{
int _type;
}
// Initializing an Expression
/*!
Initializes the receiver with the specified expression type.
@param type The type of the new expression, as defined by CPExpressionType.
@return An initialized CPExpression object of the type type.
*/
- (id)initWithExpressionType:(int)type
{
_type = type;
return self;
}
//Creating an Expression for a Value
/*!
Returns a new expression that represents a given constant value.
@param value The constant value the new expression is to represent.
@return A new expression that represents the constant value.
*/
+ (CPExpression)expressionForConstantValue:(id)value
{
return [[_CPConstantValueExpression alloc] initWithValue:value];
}
/*!
Returns a new expression that represents the object being evaluated.
@return A new expression that represents the object being evaluated.
*/
+ (CPExpression)expressionForEvaluatedObject
{
return [_CPSelfExpression evaluatedObject];
}
/*!
Returns a new expression that extracts a value from the variable bindings dictionary for a given key.
@param string The key for the variable to extract from the variable bindings dictionary.
@return A new expression that extracts from the variable bindings dictionary the value for the key string.
*/
+ (CPExpression)expressionForVariable:(CPString)string
{
return [[_CPVariableExpression alloc] initWithVariable:string];
}
/*!
Returns a new expression that invokes valueForKeyPath: with a given key path.
@param keyPath The key path that the new expression should evaluate.
@return A new expression that invokes valueForKeyPath: with keyPath.
*/
+ (CPExpression)expressionForKeyPath:(CPString)keyPath
{
return [[_CPKeyPathExpression alloc] initWithKeyPath:keyPath];
}
/*!
Returns a new aggregate expression for a given collection.
@param collection A collection object (an instance of CPArray, CPSet, or CPDictionary) that contains further expressions.
@return A new expression that contains the expressions in collection.
*/
+ (CPExpression)expressionForAggregate:(CPArray)collection
{
return [[_CPAggregateExpression alloc] initWithAggregate:collection];
}
/*!
Returns a new CPExpression object that represent the union of a given set and collection.
@param left An expression that evaluates to a CPSet object.
@param right An expression that evaluates to a collection object (an instance of CPArray, CPSet, or CPDictionary).
@return A new CPExpression object that represents the union of left and right.
*/
+ (CPExpression)expressionForUnionSet:(CPExpression)left with:(CPExpression)right
{
return [[_CPSetExpression alloc] initWithType:CPUnionSetExpressionType left:left right:right];
}
/*!
Returns a new CPExpression object that represent the intersection of a given set and collection.
@param left An expression that evaluates to a CPSet object.
@param right An expression that evaluates to a collection object (an instance of CPArray, CPSet, or CPDictionary).
@return A new CPExpression object that represents the intersection of left and right.
*/
+ (CPExpression)expressionForIntersectSet:(CPExpression)left with:(CPExpression)right
{
return [[_CPSetExpression alloc] initWithType:CPIntersectSetExpressionType left:left right:right];
}
/*!
Returns a new CPExpression object that represent the subtraction of a given collection from a given set.
@param left An expression that evaluates to a CPSet object.
@param left An expression that evaluates to a collection object (an instance of CPArray, CPSet, or CPDictionary).
@return A new CPExpression object that represents the subtraction of right from left.
*/
+ (CPExpression)expressionForMinusSet:(CPExpression)left with:(CPExpression)right
{
return [[_CPSetExpression alloc] initWithType:CPMinusSetExpressionType left:left right:right];
}
// Creating an Expression for a Function
/*!
Returns a new expression that will invoke one of the predefined functions.
@param function_name The name of the function to invoke.
@param parameters An array containing CPExpression objects that will be used as parameters during the invocation of selector.
@return A new expression that invokes the function name using the parameters in parameters.
For a selector taking no parameters, the array should be empty. For a selector taking one or more parameters,
the array should contain one CPExpression object which will evaluate to an instance of the appropriate type for each parameter.
If there is a mismatch between the number of parameters expected and the number you provide during evaluation,
an exception may be raised or missing parameters may simply be replaced by nil (which occurs depends on how many
parameters are provided, and whether you have over- or underflow).
The name parameter can be one of the following predefined functions:
@verbatim
name parameter array contents returns
-------------------------------------------------------------------------------------------------------------------------------------
sum: CPExpression instances representing numbers CPNumber
count: CPExpression instances representing numbers CPNumber
min: CPExpression instances representing numbers CPNumber
max: CPExpression instances representing numbers CPNumber
average: CPExpression instances representing numbers CPNumber
median: CPExpression instances representing numbers CPNumber
mode: CPExpression instances representing numbers CPArray (returned array will contain all occurrences of the mode)
stddev: CPExpression instances representing numbers CPNumber
add:to: CPExpression instances representing numbers CPNumber
from:subtract: two CPExpression instances representing numbers CPNumber
multiply:by: two CPExpression instances representing numbers CPNumber
divide:by: two CPExpression instances representing numbers CPNumber
modulus:by: two CPExpression instances representing numbers CPNumber
sqrt: one CPExpression instance representing numbers CPNumber
log: one CPExpression instance representing a number CPNumber
ln: one CPExpression instance representing a number CPNumber
raise:toPower: one CPExpression instance representing a number CPNumber
exp: one CPExpression instance representing a number CPNumber
floor: one CPExpression instance representing a number CPNumber
ceiling: one CPExpression instance representing a number CPNumber
abs: one CPExpression instance representing a number CPNumber
trunc: one CPExpression instance representing a number CPNumber
uppercase: one CPExpression instance representing a string CPString
lowercase: one CPExpression instance representing a string CPString
random: one CPExpression instance representing a number CPNumber (integer) such that 0 <= rand < param
now: none [CPDate now]
This method raises an exception immediately if the selector is invalid; it raises an exception at runtime if the parameters are incorrect.
@endverbatim
*/
+ (CPExpression)expressionForFunction:(CPString)function_name arguments:(CPArray)parameters
{
return [[_CPFunctionExpression alloc] initWithSelector:CPSelectorFromString(function_name) arguments:parameters];
}
/*!
Returns an expression which will return the result of invoking on a given target a selector with a given name using given arguments.
@param target A CPExpression object which will evaluate an object on which the selector identified by name may be invoked.
@param selectorName The name of the method to be invoked.
@param parameters An array containing CPExpression objects which can be evaluated to provide parameters for the method specified by name.
@return An expression which will return the result of invoking the selector named name on the result of evaluating the target expression with the parameters specified by evaluating the elements of parameters.
See the description of \c expressionForFunction:arguments: for examples of how to construct the parameter array.
*/
+ (CPExpression)expressionForFunction:(CPExpression)target selectorName:(CPString)selectorName arguments:(CPArray)parameters
{
return [[_CPFunctionExpression alloc] initWithTarget:target selector:CPSelectorFromString(selectorName) arguments:parameters];
}
/*!
Returns an expression that filters a collection by storing elements in the collection in a given variable and keeping the elements for which qualifier returns true.
@param expression A CPExpression that evaluates to a collection.
@param variable Used as a local variable, and will shadow any instances of variable in the bindings dictionary. The variable is removed or the old value replaced once evaluation completes.
@param predicate The predicate used to determine whether the element belongs in the result collection.
@return An expression that filters a collection by storing elements in the collection in the variable variable and keeping the elements for which qualifier returns true.
*/
+ (CPExpression)expressionForSubquery:(CPExpression)expression usingIteratorVariable:(CPString)variable predicate:(CPPredicate)predicate
{
return [[_CPSubqueryExpression alloc] initWithExpression:expression usingIteratorVariable:variable predicate:predicate];
}
// Getting Information About an Expression
/*!
Returns the expression type for the receiver.
@return The expression type for the receiver.
This method raises an exception if it is not applicable to the receiver.
*/
- (int)expressionType
{
return _type;
}
/*!
Returns the constant value of the receiver.
@return The constant value of the receiver.
This method raises an exception if it is not applicable to the receiver.
*/
- (id)constantValue
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the variable for the receiver.
@return The variable for the receiver.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPString)variable
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the key path for the receiver.
@return The key path for the receiver.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPString)keyPath
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the function for the receiver.
@return The function for the receiver.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPString)function
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the arguments for the receiver.
@return The arguments for the receiver—that is, the array of expressions that will be passed as parameters during invocation of the selector on the operand of a function expression.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPArray)arguments
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the collection of expressions in an aggregate expression, or the collection element of a subquery expression.
@return The collection of expressions in an aggregate expression, or the collection element of a subquery expression.
This method raises an exception if it is not applicable to the receiver.
*/
- (id)collection
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the predicate in a subquery expression.
@return The predicate in a subquery expression..
This method raises an exception if it is not applicable to the receiver.
*/
- (CPPredicate)predicate
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the operand for the receiver.
@return The operand for the receiver—that is, the object on which the selector will be invoked.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPExpression)operand
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the left expression of a set expression.
@return The left expression of a set expression.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPExpression)leftExpression
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
/*!
Returns the right expression of a set expression.
@return The right expression of a set expression.
This method raises an exception if it is not applicable to the receiver.
*/
- (CPExpression)rightExpression
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
return nil;
}
- (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)variables
{
return self;
}
@end
//@import "_CPConstantValueExpression.j"
//@import "_CPSelfExpression.j"
//@import "_CPVariableExpression.j"
//@import "_CPKeyPathExpression.j"
//@import "_CPFunctionExpression.j"
//@import "_CPAggregateExpression.j"
//@import "_CPSetExpression.j"
//@import "_CPSubqueryExpression.j"
+1 -1
View File
@@ -710,7 +710,7 @@ var CPStringUIDs = new CFMutableDictionary(),
*/
- (CPArray)pathComponents
{
if (length === 0)
if (self.length === 0)
return [""];
if (self === "/")
-2
View File
@@ -75,8 +75,6 @@
@import "CPValue.j"
@import "CPValueTransformer.j"
@import "_CPJavaScriptArray.j"
/*! @mainpage
Cappuccino is distributed under the @ref license "GNU LGPL".
+18 -4
View File
@@ -479,17 +479,31 @@ ObjJCompiler.prototype.nodeFunctionExpression = function(/*SyntaxNode*/ astNode)
this.assertNode(astNode, ObjJCompiler.AstNodeFunctionExpression);
var children = astNode.children,
child = children[2],
offset = 0;
offset = 0,
saveJSBuffer = this._jsBuffer;
this._jsBuffer = null;
this.nodeFUNCTION(children[0]);
this.nodeUnderline(children[1], true);
var identifier = null;
if (child && child.name === ObjJCompiler.AstNodeIdentifier)
{
this.nodeIdentifier(child);
identifier = this.nodeIdentifier(child);
offset++;
}
this.nodeUnderline(children[2 + offset], false);
this.nodeWORD(children[3 + offset]);
if (saveJSBuffer)
if (identifier)
{
CONCAT(saveJSBuffer, identifier);
CONCAT(saveJSBuffer, " = function");
}
else
{
CONCAT(saveJSBuffer, "function");
}
this._jsBuffer = saveJSBuffer;
this.nodeOpenParenthesis(children[3 + offset]);
this.nodeUnderline(children[4 + offset], false);
child = children[5 + offset];
@@ -500,7 +514,7 @@ ObjJCompiler.prototype.nodeFunctionExpression = function(/*SyntaxNode*/ astNode)
offset++;
}
this.nodeUnderline(children[5 + offset], false);
this.nodeWORD(children[6 + offset]);
this.nodeCloseParenthesis(children[6 + offset]);
this.nodeUnderline(children[7 + offset], false);
this.nodeOpenBrace(children[8 + offset]);
this.nodeUnderline(children[9 + offset], false);
+1 -1
View File
@@ -1,5 +1,5 @@
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <AppKit/CPArrayController.j>
@import <AppKit/CPTextField.j>
+11 -10
View File
@@ -1,4 +1,5 @@
@import <AppKit/AppKit.j>
@import <Foundation/CPExpression.j>
@implementation CPPredicateEditorTest : OJTestCase
{
@@ -13,35 +14,35 @@
- (void)testTemplatesMerging
{
var le1 = [CPExpression expressionForKeyPath:@"keypath1"],
le2 = [CPExpression expressionForKeyPath:@"keypath2"],
le3 = [CPExpression expressionForKeyPath:@"keypath3"];
le2 = [CPExpression expressionForKeyPath:@"keypath2"],
le3 = [CPExpression expressionForKeyPath:@"keypath3"];
var lexps1 = [le1, le2],
var lexps1 = [le1, le2],
lexps2 = [le2, le3];
var ops1 = [CPBeginsWithPredicateOperatorType, CPEndsWithPredicateOperatorType],
ops2 = [CPGreaterThanPredicateOperatorType, CPEqualToPredicateOperatorType];
var t1 = [[CPPredicateEditorRowTemplate alloc] initWithLeftExpressions:lexps1 rightExpressionAttributeType:CPStringAttributeType modifier:0 operators:ops1 options:0],
t2 = [[CPPredicateEditorRowTemplate alloc] initWithLeftExpressions:lexps2 rightExpressionAttributeType:CPInteger16AttributeType modifier:0 operators:ops2 options:0];
var errorFormat = @"The left criterion %@ should have children with the following templates:\n%@\nbut was:\n%@";
[_editor setRowTemplates:[t1, t2]];
var trees = _editor._rootTrees;
var count = [trees count];
// We are expecting 3 criterion on the left.
[self assertTrue:(count == 3) message:"We should have 3 criterion on the left, was " + count];
[self assertTrue:(count == 3) message:"We should have 3 criterion on the left, was " + count];
for (var i = 0; i < count; i++)
{
var aTree = [trees objectAtIndex:i],
title = [aTree title],
templates = [[aTree children] valueForKey:@"template"],
expected;
if ([title isEqualToString:@"keypath1"])
expected = [t1, t1];
else if ([title isEqualToString:@"keypath2"])
+1 -1
View File
@@ -1,4 +1,4 @@
@import <AppKit/CPTokenField.j>
@import <AppKit/AppKit.j>
[CPApplication sharedApplication];
@@ -174,5 +174,5 @@
@end
@import "TableViewDataSource.j"
//@import "TableViewDataSource.j"
@@ -23,6 +23,7 @@
*/
@import "Bookmark.j"
@import "MyDocument.j"
@implementation MyDocument (TableView)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "MyDocument.j"
@import "TableViewDataSource.j"
/*!
Bindings test exercising the functionality seen in the Cocoa example "WithAndWithoutBindings" part 1. Part 1 does in fact not use bindings and serves only as a base line test case.
@@ -90,4 +90,4 @@
[self assert:@"http://www.cappuccino.org" equals:[theDocument.selectedBookmarkURLField stringValue]];
}
@end
@end
@@ -22,7 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@implementation Bookmark : CPObject
@implementation Bookmark2 : CPObject
{
CPString title @accessors;
CPDate creationDate @accessors;
@@ -22,9 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "Bookmark.j"
@import "Bookmark2.j"
@implementation MyDocument : CPDocument
@implementation MyDocument2 : CPDocument
{
CPString name @accessors;
CPString collectionDescription @accessors;
@@ -389,7 +389,7 @@
<string>title</string>
<string>URL</string>
</object>
<string key="NSObjectClassName">Bookmark</string>
<string key="NSObjectClassName">Bookmark2</string>
<bool key="NSEditable">YES</bool>
<object class="_NSManagedProxy" key="_NSManagedProxy"/>
<bool key="NSAvoidsEmptySelection">YES</bool>
@@ -22,7 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "Bookmark.j"
@import "Bookmark2.j"
// In 02 this is a subclass of CPArrayController.
@implementation MyArrayController : CPArrayController
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "MyDocument.j"
@import "MyDocument2.j"
@import "StringToURLTransformer.j"
/*!
@@ -39,7 +39,7 @@
- (void)test
{
var theDocument = [MyDocument new],
var theDocument = [MyDocument2 new],
cib = [CPBundle loadCibFile:[[CPBundle bundleForClass:WithBindingsTest] pathForResource:"02_WithBindings.cib"] externalNameTable:[CPDictionary dictionaryWithObject:theDocument forKey:CPCibOwner]];
[theDocument windowControllerDidLoadCib:self];
@@ -90,4 +90,4 @@
[self assert:@"http://www.cappuccino.org" equals:[theDocument.selectedBookmarkURLField stringValue]];
}
@end
@end
+4 -3
View File
@@ -1,6 +1,6 @@
var FILE = require("file");
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPString.j>
@import <Foundation/CPNumber.j>
@import <Foundation/CPSortDescriptor.j>
@@ -26,6 +26,7 @@ var ELEMENTS = 100,
CPLog.warn("\nNUMERIC ALMOST SORTED");
var a = [self makeUnsorted],
sorted = [self sort:a usingSortSelector:@selector(sortedArrayUsingDescriptors:) withObject:descriptors];
print("a: " + (a == sorted ? "Yes" : "No"));
[self checkAlmostSorted:sorted];
}
@@ -227,7 +228,7 @@ var ELEMENTS = 100,
{
var count = [descriptors count];
sort(function(lhs, rhs)
self.sort(function(lhs, rhs)
{
var i = 0,
result = CPOrderedSame;
@@ -251,7 +252,7 @@ var ELEMENTS = 100,
- (CPArray)_native_sortUsingSelector:(SEL)aSelector
{
sort(function(lhs, rhs)
self.sort(function(lhs, rhs)
{
return [lhs performSelector:aSelector withObject:rhs];
});
+1 -1
View File
@@ -600,4 +600,4 @@ function testAttributeAtIndexWithValue(aString, anIndex, aKey, aValue, aSelf)
function printRangeEntry(entry)
{
print("range: " + CPStringFromRange(entry.range) + " " + [entry.attributes description]);
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
@import <Foundation/_CPJavaScriptArray.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPData.j>
@import <Foundation/CPDictionary.j>
@import <Foundation/CPKeyedArchiver.j>
+2 -2
View File
@@ -1,6 +1,6 @@
@import <Foundation/CPInvocationOperation.j>
@implementation SomeObject : CPObject
@implementation SomeObject2 : CPObject
{
CPString result @accessors;
}
@@ -17,7 +17,7 @@
- (void)testRunInvocation
{
var so = [[SomeObject alloc] init],
var so = [[SomeObject2 alloc] init],
io = [[CPInvocationOperation alloc] initWithTarget:so selector:@selector(setAString:) object:@"Hello World"];
[io start];
+2 -2
View File
@@ -328,7 +328,7 @@ var COUNTER;
[self assert:[two valueForKeyPath:"@max.intValue"] equals:8];
[self assert:[two valueForKeyPath:"@min.intValue"] equals:0];
var a = [A new];
var a = [AA new];
[a setValue:one forKey:"b"];
[self assert:[a valueForKeyPath:"b.@count"] equals:8];
[self assert:[a valueForKeyPath:"b.@sum.intValue"] equals:8];
@@ -347,7 +347,7 @@ var COUNTER;
@end
@implementation A : CPObject
@implementation AA : CPObject
{
id b;
}
+2 -2
View File
@@ -431,7 +431,7 @@
- (void)testDependentKeysPaths
{
var object = [[TestObject alloc] init];
var object = [[TestObject2 alloc] init];
[object addObserver:self forKeyPath:@"key" options:0 context:@"testDependentKeysPaths"];
@@ -879,7 +879,7 @@
}
@end
@implementation TestObject : CPObject
@implementation TestObject2 : CPObject
{
CPString key @accessors;
CPString affectingKey @accessors;
+5 -5
View File
@@ -480,8 +480,8 @@ var accessIVARS = YES;
- (void)testValueForKeyPath
{
var department = [Department departmentWithName:@"Engineering"],
employee = [Employee employeeWithName:@"Klaas Pieter" department:department];
var department = [Department2 departmentWithName:@"Engineering"],
employee = [Employee2 employeeWithName:@"Klaas Pieter" department:department];
[self assert:department equals:[employee valueForKey:@"department"]];
[self assert:@"Engineering" equals:[employee valueForKeyPath:@"department.name"]];
@@ -489,10 +489,10 @@ var accessIVARS = YES;
@end
@implementation Employee : CPObject
@implementation Employee2 : CPObject
{
CPString _name @accessors(property=name);
Department _department @accessors(property=department);
Department2 _department @accessors(property=department);
}
+ (id)employeeWithName:(CPString)theName department:(Department)theDepartment
@@ -513,7 +513,7 @@ var accessIVARS = YES;
@end
@implementation Department : CPObject
@implementation Department2 : CPObject
{
CPString _name @accessors(property=name);
}
+6 -6
View File
@@ -1,6 +1,6 @@
@import <Foundation/CPOperation.j>
@implementation TestOperation : CPOperation
@implementation TestOperation2 : CPOperation
{
CPString name @accessors;
CPString value @accessors;
@@ -13,7 +13,7 @@
@end
@implementation TestObserver : CPObject
@implementation TestObserver2 : CPObject
{
CPArray changedKeyPaths @accessors;
}
@@ -106,7 +106,7 @@
- (void)testCompletionFunction
{
var to = [[TestOperation alloc] init];
var to = [[TestOperation2 alloc] init];
[to setCompletionFunction:function() {[to setValue:@"something"];}];
[to start];
@@ -118,9 +118,9 @@
- (void)testKVO
{
var to = [[TestOperation alloc] init],
to2 = [[TestOperation alloc] init],
obs = [[TestObserver alloc] init];
var to = [[TestOperation2 alloc] init],
to2 = [[TestOperation2 alloc] init],
obs = [[TestObserver2 alloc] init];
[to addObserver:obs
forKeyPath:@"isCancelled"
+16 -16
View File
@@ -2,14 +2,14 @@
- (void)testThatSubclassTollFreeDoesAllowForSubclassingDictionary
{
var target = [[MyDict alloc] init];
var target = [[MyDict2 alloc] init];
[OJAssert assert:@"a" equals:[target newMessage]];
[OJAssert assert:0 equals:[target count]];
}
- (void)testThatSubclassTollFreeDoesAllowForSubclassingString
{
var target = [[MyString alloc] initWithString:@"adsf"];
var target = [[MyString2 alloc] initWithString:@"adsf"];
[OJAssert assert:@"a" equals:[target newMessage]];
[OJAssert assert:4 equals:[target length]];
@@ -20,42 +20,42 @@
- (void)testThatSubclassTollFreeDoesAllowForSubclassingNumber
{
var target = [[MyNum alloc] init];
var target = [[MyNum2 alloc] init];
[OJAssert assert:@"a" equals:[target newMessage]];
[OJAssert assertFalse:[target isEqualToNumber:5]];
}
- (void)testThatSubclassTollFreeDoesAllowForSubclassingException
{
var target = [[MyException alloc] init];
var target = [[MyException2 alloc] init];
[OJAssert assert:@"a" equals:[target newMessage]];
// there are no internal properties to test here.. so no need to jimmyrig it.
}
- (void)testThatSubclassTollFreeDoesAllowForSubclassingArray
{
var target = [[MyArray alloc] initWithObjects:@"a"];
var target = [[MyArray2 alloc] initWithObjects:@"a"];
[OJAssert assert:@"a" equals:[target newMessage]];
[OJAssert assert:1 equals:[target count]];
}
- (void)testThatSubclassTollFreeDoesAllowForSubclassingDate
{
var target = [[MyDate alloc] init];
var target = [[MyDate2 alloc] init];
[OJAssert assert:@"a" equals:[target newMessage]];
[OJAssert assertTrue:[target timeIntervalSince1970] > 0];
}
- (void)testThatSubclassTollFreeDoesAllowForSubclassingData
{
var target = [[MyData alloc] initWithRawString:@"b"];
var target = [[MyData2 alloc] initWithRawString:@"b"];
[OJAssert assert:@"a" equals:[target newMessage]];
[OJAssert assert:@"b" equals:[target rawString]];
}
- (void)testThatSubclassTollFreeDoesAllowForSubclassingURL
{
var target = [[MyURL alloc] initWithString:@"http://www.google.com"];
var target = [[MyURL2 alloc] initWithString:@"http://www.google.com"];
[OJAssert assert:@"a" equals:[target newMessage]];
[OJAssert assert:@"http://www.google.com" equals:[target absoluteString]];
}
@@ -65,7 +65,7 @@
@import <Foundation/CPDictionary.j>
@implementation MyDict : CPDictionary
@implementation MyDict2 : CPDictionary
- (id)newMessage
{
@@ -74,7 +74,7 @@
@end
@implementation MyNum : CPNumber
@implementation MyNum2 : CPNumber
- (id)newMessage
{
@@ -83,7 +83,7 @@
@end
@implementation MyString : CPString
@implementation MyString2 : CPString
- (id)newMessage
{
@@ -92,7 +92,7 @@
@end
@implementation MyException : CPException
@implementation MyException2 : CPException
- (id)newMessage
{
@@ -101,7 +101,7 @@
@end
@implementation MyArray : CPArray
@implementation MyArray2 : CPArray
{
CPArray _storage;
}
@@ -133,7 +133,7 @@
@end
@implementation MyDate : CPDate
@implementation MyDate2 : CPDate
- (id)newMessage
{
@@ -142,7 +142,7 @@
@end
@implementation MyData : CPData
@implementation MyData2 : CPData
- (id)newMessage
{
@@ -151,7 +151,7 @@
@end
@implementation MyURL : CPURL
@implementation MyURL2 : CPURL
- (id)newMessage
{
+1
View File
@@ -37,6 +37,7 @@
@implementation RootClassWithForwardingTarget
{
Class isa;
}
+ (void)initialize