![]() |
API
0.9.6
|
Classes | |
class | CPArray |
A mutable array backed by a JavaScript Array.A mutable array class backed by a JavaScript Array. There is also a CPMutableArray class, but it is just a child class of this class with an empty implementation. All mutable functionality is implemented directly in CPArray. More... | |
class | CPAttributedString |
A mutable character string with attributes. More... | |
class | CPBundle |
Groups information about an application's code & resources. More... | |
class | CPCoder |
Defines methods for use when archiving & restoring (enc/decoding). More... | |
class | CPComparisonPredicate |
CPComparisonPredicate is a subclass of CPPredicate used to compare expressions. More... | |
class | CPCompoundPredicate |
CPCompoundPredicate is a subclass of CPPredicate used to represent logical “gate” operations (AND/OR/NOT) and comparison operations. More... | |
class | CPCountedSet |
An mutable collection which may contain a specific object numerous times. More... | |
class | CPData |
A Cappuccino wrapper for any data type. More... | |
class | CPDate |
A representation of a single point in time. More... | |
class | CPDateFormatter |
class | CPDecimalNumber |
Decimal floating point number. More... | |
class | CPDecimalNumberHandler |
Decimal floating point number exception and rounding behavior. This class is mutable. More... | |
class | CPDictionary |
A mutable key-value pair collection. More... | |
class | CPEnumerator |
Defines an interface for enumerators. More... | |
class | CPException |
Used to implement exception handling (creating & raising). More... | |
class | CPExpression |
CPExpression is used to represent expressions in a predicate. More... | |
class | CPFormatter |
CPFormatter is an abstract class that declares an interface for objects that create, interpret, and validate the textual representation of cell contents. The Foundation framework provides two concrete subclasses of CPFormatter to generate these objects: CPNumberFormatter and CPDateFormatter. More... | |
class | CPIndexSet |
A collection of unique integers. More... | |
class | CPInvocation |
An object representation of a message. More... | |
class | CPJSONPConnection |
Allows cross domain connections using JSONP protocol. More... | |
class | CPKeyedArchiver |
Implements keyed archiving of object graphs (e.g. for storing data). More... | |
class | CPKeyedUnarchiver |
Unarchives objects created using CPKeyedArchiver. More... | |
class | CPNotification |
A notification that can be posted to a CPNotificationCenter. More... | |
class | CPNotificationCenter |
Sends messages (CPNotification) between objects. More... | |
class | CPNull |
An object representation of nil . More... | |
class | CPNumber |
A bridged object to native Javascript numbers. More... | |
class | CPNumberFormatter |
class | CPObject |
The root class from which most classes are subclassed. More... | |
class | CPPredicate |
The CPPredicate class is used to define logical conditions used to constrain a search either for a fetch or for in-memory filtering. More... | |
class | CPRunLoop |
The main run loop for the application. More... | |
class | CPSortDescriptor |
Holds attributes necessary to describe how to sort a set of objects. More... | |
class | CPString |
An immutable string (collection of characters). More... | |
class | CPTimer |
A timer object that can send a message after the given time interval. More... | |
class | CPUndoManager |
A general mechanism for user action "undo". More... | |
class | CPURLConnection |
Provides loading of a URL request. More... | |
class | CPURLRequest |
Contains data obtained during a request made with CPURLConnection. More... | |
class | CPURLResponse |
Protocol agnostic information about a request to a specific URL. More... | |
class | CPUserDefaults |
class | CPValue |
A generic "value". Can be subclassed to hold specific data types. More... | |
Functions | |
function | CPDecimalAdd (result, leftOperand, rightOperand, roundingMode, longMode) |
function | CPDecimalCompact (dcm) |
function | CPDecimalCompare (leftOperand, rightOperand) |
function | CPDecimalCopy (dcm) |
function | CPDecimalDivide (result, leftOperand, rightOperand, roundingMode) |
function | CPDecimalIsNotANumber (dcm) |
function | CPDecimalIsOne (dcm) |
function | CPDecimalIsZero (dcm) |
function | CPDecimalMakeNaN () |
function | CPDecimalMakeOne () |
function | CPDecimalMakeWithParts (mantissa, exponent) |
function | CPDecimalMakeWithString (string, locale) |
function | CPDecimalMakeZero () |
function | CPDecimalMultiply (result, leftOperand, rightOperand, roundingMode, powerMode) |
function | CPDecimalMultiplyByPowerOf10 (result, dcm, power, roundingMode) |
function | CPDecimalNormalize (dcm1, dcm2, roundingMode, longMode) |
function | CPDecimalPower (result, dcm, power, roundingMode) |
function | CPDecimalRound (result, dcm, scale, roundingMode) |
function | CPDecimalString (dcm, locale) |
function | CPDecimalSubtract (result, leftOperand, rightOperand, roundingMode) |
function | CPIntersectionRange (lhsRange, rhsRange) |
return | CPMakeRange (location, MAX(CPMaxRange(lhsRange), CPMaxRange(rhsRange))-location) |
function | CPRangeFromString (aString) |
function | CPRangeInRange (lhsRange, rhsRange) |
function | CPStringFromRange (aRange) |
Variables | |
rhsRange | |
function CPDecimalAdd | ( | result | , |
leftOperand | , | ||
rightOperand | , | ||
roundingMode | , | ||
longMode | |||
) |
Performs the addition of 2 CPDecimal numbers.
result | the CPDecimal object in which to put the result |
leftOperand | the left CPDecimal operand |
rightOperand | the right CPDecimal operand |
roundingMode | the rounding mode for the operation |
Definition at line 519 of file CPDecimal.j.
function CPDecimalCompact | ( | dcm | ) |
Remove trailing and leading zeros from mantissa.
dcm | the CPDecimal operand |
Definition at line 1403 of file CPDecimal.j.
function CPDecimalCompare | ( | leftOperand | , |
rightOperand | |||
) |
Compare two CPDecimal objects. Order is left to right (i.e. Ascending would mean left is smaller than right operand).
leftOperand | the left CPDecimal |
rightOperand | the right CPDecimal |
Definition at line 367 of file CPDecimal.j.
function CPDecimalCopy | ( | dcm | ) |
Create a copy of a CPDecimal object
dcm | the CPDecimal number to copy. |
Definition at line 349 of file CPDecimal.j.
function CPDecimalDivide | ( | result | , |
leftOperand | , | ||
rightOperand | , | ||
roundingMode | |||
) |
Performs a division of 2 CPDecimal numbers.
result | the CPDecimal object in which to put the result |
leftOperand | the left CPDecimal operand |
rightOperand | the right CPDecimal operand |
roundingMode | the rounding mode for the operation |
Definition at line 858 of file CPDecimal.j.
function CPDecimalIsNotANumber | ( | dcm | ) |
Checks to see if a CPDecimal is Not A Number.
Definition at line 338 of file CPDecimal.j.
function CPDecimalIsOne | ( | dcm | ) |
Checks to see if a CPDecimal is 1. Can handle uncompacted strings (it compacts them).
Definition at line 292 of file CPDecimal.j.
function CPDecimalIsZero | ( | dcm | ) |
Checks to see if a CPDecimal is zero. Can handle uncompacted strings.
Definition at line 272 of file CPDecimal.j.
function CPDecimalMakeNaN | ( | ) |
Creates a CPDecimal NaN.
Definition at line 239 of file CPDecimal.j.
function CPDecimalMakeOne | ( | ) |
Creates a CPDecimal 1.
Definition at line 228 of file CPDecimal.j.
function CPDecimalMakeWithParts | ( | mantissa | , |
exponent | |||
) |
Creates a CPDecimal object from a given mantissa and exponent. The sign is taken from the sign of the mantissa. This cant do a full 34 digit mantissa representation as JS's 32 bits or 64bit binary FP numbers cant represent that. So use the CPDecimalMakeWithString if you want longer mantissa.
mantissa | the mantissa (though see above note) |
exponent | the exponent |
Definition at line 182 of file CPDecimal.j.
function CPDecimalMakeWithString | ( | string | , |
locale | |||
) |
Creates a CPDecimal object from a string representation of the decimal number.
decimalString | CPString of number |
roundingMode | Rounding mode for when number is too large to fit in mantissa. |
Definition at line 101 of file CPDecimal.j.
function CPDecimalMakeZero | ( | ) |
Creates a CPDecimal 0.
Definition at line 218 of file CPDecimal.j.
function CPDecimalMultiply | ( | result | , |
leftOperand | , | ||
rightOperand | , | ||
roundingMode | , | ||
powerMode | |||
) |
Performs multiplication of 2 CPDecimal numbers.
result | the CPDecimal object in which to put the result |
leftOperand | the left CPDecimal operand |
rightOperand | the right CPDecimal operand |
roundingMode | the rounding mode for the operation |
Definition at line 997 of file CPDecimal.j.
function CPDecimalMultiplyByPowerOf10 | ( | result | , |
dcm | , | ||
power | , | ||
roundingMode | |||
) |
Raises a CPDecimal number to a power of 10.
result | the CPDecimal object in which to put the result |
dcm | the CPDecimal operand |
power | the power to raise to |
roundingMode | the rounding mode for the operation |
Definition at line 1094 of file CPDecimal.j.
function CPDecimalNormalize | ( | dcm1 | , |
dcm2 | , | ||
roundingMode | , | ||
longMode | |||
) |
Normalises 2 CPDecimals. Normalisation is the process of modifying a numbers mantissa to ensure that both CPDecimals have the same exponent.
dcm1 | the first CPDecimal |
dcm2 | the second CPDecimal |
roundingMode | the rounding mode for the operation |
Definition at line 1173 of file CPDecimal.j.
function CPDecimalPower | ( | result | , |
dcm | , | ||
power | , | ||
roundingMode | |||
) |
Raises a CPDecimal number to the given power.
result | the CPDecimal object in which to put the result |
dcm | the CPDecimal operand |
power | the power to raise to |
roundingMode | the rounding mode for the operation |
Definition at line 1121 of file CPDecimal.j.
function CPDecimalRound | ( | result | , |
dcm | , | ||
scale | , | ||
roundingMode | |||
) |
Rounds a CPDecimal off at a given decimal position. scale specifies the position. Negative values of scale imply rounding in the whole numbers and positive values rounding in the decimal places. A scale of 0 rounds to the first whole number.
result | the CPDecimal object in which to put the result |
dcm | the CPDecimal operand |
scale | the position to round to |
roundingMode | the rounding mode for the operation |
Definition at line 1295 of file CPDecimal.j.
function CPDecimalString | ( | dcm | , |
locale | |||
) |
Convert a CPDecimal to a string representation.
dcm | the CPDecimal operand |
locale | the locale to use for the conversion |
Definition at line 1444 of file CPDecimal.j.
function CPDecimalSubtract | ( | result | , |
leftOperand | , | ||
rightOperand | , | ||
roundingMode | |||
) |
Performs the subtraction of 2 CPDecimal numbers.
result | the CPDecimal object in which to put the result |
leftOperand | the left CPDecimal operand |
rightOperand | the right CPDecimal operand |
roundingMode | the rounding mode for the operation |
Definition at line 666 of file CPDecimal.j.
function CPIntersectionRange | ( | lhsRange | , |
rhsRange | |||
) |
return CPMakeRange | ( | location | , |
MAX(CPMaxRange(lhsRange), CPMaxRange(rhsRange))- | location | ||
) |
function CPRangeFromString | ( | aString | ) |
function CPRangeInRange | ( | lhsRange | , |
rhsRange | |||
) |
Checks if a range completely contains another range. In other words, if one range is the "super range" of another.
lhsRange | the containing range |
rhsRange | the range we are testing to see if lhsRange contains it CPRange |
function CPStringFromRange | ( | aRange | ) |