usbdmx.com Home of the opto isolated, bus powered, DMX512 interface with both in and out universes. Cheap and simple to build. USBDMX logo

LOCommandToken Class Reference

A command token is an object to represent a specifica part of a command string. More...

#import <LOCommandToken.h>


Public Member Functions

(id) - initWithType:
 Initilise a token with its type.
(id) - initWithType:andValue:
 Initilise a token with its type and value.
(LOCommandTokenType) - type
 Get the tokens type.
(void) - setType:
 Allows you to change the token type.
(float) - value
 Get the tokens value.
(void) - setValue:
 Set the tokens value.
(void) - setValue:withPlaces:
 Set the tokens value, and the number of digits to show after the decimla place when viewing as a string.
(BOOL) - hasLeadingZero
 True if the numeric value has a leading zero.
(void) - setLeadingZero:
 Sets if a numeric token has a leading zero.
(BOOL) - hasDP
 True if the numeric value has a decimal point.
(void) - setDP:
 Sets if a numeric token has a decima point.
(BOOL) - didOverflow
 True if a numerical value has been set via the button tokeniser, and more than 3 digits were used after the decimal place.
(void) - setOverflow:
 Set the overflow flag.
(NSString *) - stringValue
 The string value of this token, as found in a command line.
(void) - setStringValue:
 When a custom token type value is used, you will need to set the string value to be returned by stringValue.

Static Public Member Functions

(LOCommandToken *) + thruCommandToken
 Convenience function to get a ready made token of type Thru.
(LOCommandToken *) + plusCommandToken
 Convenience function to get a ready made token of type Plus.
(LOCommandToken *) + minusCommandToken
 Convenience function to get a ready made token of type Minus.
(LOCommandToken *) + atCommandToken
 Convenience function to get a ready made token of type At.
(LOCommandToken *) + onCommandToken
 Convenience function to get a ready made token of type On.
(LOCommandToken *) + offCommandToken
 Convenience function to get a ready made token of type Off.
(LOCommandToken *) + soloCommandToken
 Convenience function to get a ready made token of type Solo.
(LOCommandToken *) + releaseCommandToken
 Convenience function to get a ready made token of type Release.
(LOCommandToken *) + lastCommandToken
 Convenience function to get a ready made token of type Last.
(LOCommandToken *) + dotCommandToken
 Convenience function to get a ready made token of type Dot.
(LOCommandToken *) + numberCommandTokenWithVaule:
 Convenience function to get a ready made token of type Number.

Protected Attributes

LOCommandTokenType type
 The token type.
float value
 The token value (if the type requires).
BOOL leadingZero
 Used to indicate the numerical value has a leading zero.
BOOL hasDP
 True of the numerical value has a decimal point.
BOOL overflow
 True if the button tokeniser added more than 3 decimal places.
int places
 How many digits to how after the DP.
NSString * stringValue
 The string value of this token, as used for display to the user.


Detailed Description

A command token is an object to represent a specifica part of a command string.

A Command string is broken up into these token, where they are processed by the command processor


Member Function Documentation

+ (LOCommandToken *) atCommandToken  

Convenience function to get a ready made token of type At.

- (BOOL) didOverflow  

True if a numerical value has been set via the button tokeniser, and more than 3 digits were used after the decimal place.

See also:
- setOverflow:

+ (LOCommandToken *) dotCommandToken  

Convenience function to get a ready made token of type Dot.

- (BOOL) hasDP  

True if the numeric value has a decimal point.

See also:
- setDP:

- (BOOL) hasLeadingZero  

True if the numeric value has a leading zero.

See also:
- setLeadingZero:

- (id) initWithType: (LOCommandTokenType)  theType  

Initilise a token with its type.

- (id) initWithType: (LOCommandTokenType)  theType
andValue: (float)  theValue 

Initilise a token with its type and value.

+ (LOCommandToken *) lastCommandToken  

Convenience function to get a ready made token of type Last.

+ (LOCommandToken *) minusCommandToken  

Convenience function to get a ready made token of type Minus.

+ (LOCommandToken *) numberCommandTokenWithVaule: (float)  theValue  

Convenience function to get a ready made token of type Number.

+ (LOCommandToken *) offCommandToken  

Convenience function to get a ready made token of type Off.

+ (LOCommandToken *) onCommandToken  

Convenience function to get a ready made token of type On.

+ (LOCommandToken *) plusCommandToken  

Convenience function to get a ready made token of type Plus.

+ (LOCommandToken *) releaseCommandToken  

Convenience function to get a ready made token of type Release.

- (void) setDP: (BOOL)  flag  

Sets if a numeric token has a decima point.

See also:
hasDP

- (void) setLeadingZero: (BOOL)  flag  

Sets if a numeric token has a leading zero.

See also:
- hasLeadingZero

- (void) setOverflow: (BOOL)  flag  

Set the overflow flag.

See also:
- didOverflow

- (void) setStringValue: (NSString *)  string  

When a custom token type value is used, you will need to set the string value to be returned by stringValue.

See also:
stringValue

- (void) setType: (LOCommandTokenType)  newType  

Allows you to change the token type.

- (void) setValue: (float)  theValue  

Set the tokens value.

See also:
value:

- setValue:withPlaces

- (void) setValue: (float)  theValue
withPlaces: (int)  thePlaces 

Set the tokens value, and the number of digits to show after the decimla place when viewing as a string.

See also:
value:

- setValue:

+ (LOCommandToken *) soloCommandToken  

Convenience function to get a ready made token of type Solo.

- (NSString *) stringValue  

The string value of this token, as found in a command line.

In the instance of a number type token the minimum number of decimal places that can be used are included. In any event no more than 3 decimal places wil be used, and should the value have more than 3 decimal places they will always be rounded down.

See also:
- setStringValue:

+ (LOCommandToken *) thruCommandToken  

Convenience function to get a ready made token of type Thru.

- (LOCommandTokenType) type  

Get the tokens type.

- (float) value  

Get the tokens value.

See also:
- setValue:


The documentation for this class was generated from the following files: