From VisualWorks®, 7.5 of April 3, 2007 on April 3, 2007 at 1:28:35 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>Constraint</name> <environment>ASN1</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.Constraint
Asn1Constraint is the abstract superclass of those classes that represent concrete constraints upon ASN.1's fundamental types. Subclasses must implement the following messages: private privatePermits:
</comment> <class> <name>NullConstraint</name> <environment>ASN1</environment> <super>ASN1.Constraint</super> <private>false</private> none default <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.NullConstraint
An Asn1ConstraintNull represents an empty constraint, one satisfied by all values. There should be only one in existence. Class Instance Variables: default <Asn1ConstraintNull> the sole instance of the class
</comment> <class> <name>SingleValueConstraint</name> <environment>ASN1</environment> <super>ASN1.Constraint</super> <private>false</private> none value <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.SingleValueConstraint
An Asn1ConstraintSingleValue is satisfied by any object that is equal to or permitted by the 'value'. Instance Variables: value <Object | Asn1Constraint | Asn1Element | Asn1Type > an Object or an implementor of 'permits:'
</comment> <class> <name>ValueUnionConstraint</name> <environment>ASN1</environment> <super>ASN1.Constraint</super> <private>false</private> none values <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.ValueUnionConstraint
An Asn1ConstraintValueUnion is satisfied by any value that is equal to any of its 'values'. Instance Variables: values <Collection> a collection of values
</comment> <class> <name>MultipleConstraintCombination</name> <environment>ASN1</environment> <super>ASN1.Constraint</super> <private>false</private> none constraints <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.MultipleConstraintCombination
Asn1ConstraintSubN is an abstract class. It is the superclass of those constraints that 'spin' a collection of more basic subconstraints. Instance Variables: constraints <(Collection of: Asn1Constraint)> da collection of subconstraints
</comment> <class> <name>ConstraintIntersection</name> <environment>ASN1</environment> <super>ASN1.MultipleConstraintCombination</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.ConstraintIntersection
An Asn1ConstraintIntersection is fulfilled by any value that satisfies all of the 'contraints'.
</comment> <class> <name>ConstraintUnion</name> <environment>ASN1</environment> <super>ASN1.MultipleConstraintCombination</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.ConstraintUnion
An Asn1ConstraintUnion is fulfilled by any value that satisfies any of the 'contraints'.
</comment> <class> <name>BlockConstraint</name> <environment>ASN1</environment> <super>ASN1.Constraint</super> <private>false</private> none blockClosure <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.BlockConstraint
An Asn1ConstraintBlockClosure is used to represent arbitrary constraints that are best implemented in VisualWorks as BlockClosures. ASN.1 itself has no notion of a block constraint. Most of the default constraints on ASN.1 universal types are implemented using Asn1ConstraintBlockClosure. Instance Variables: blockClosure <BlockClosure> a block that expresses a constraint
</comment> <class> <name>SingleConstraintCombination</name> <environment>ASN1</environment> <super>ASN1.Constraint</super> <private>false</private> none constraint <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.SingleConstraintCombination
Asn1ConstraintSub1 is an abstract class. It is the superclass of those constraints that 'spin' a single, more basic, subconstraint. Instance Variables: constraint <Asn1Constraint> the contained subconstraint
</comment> <class> <name>ExceptConstraint</name> <environment>ASN1</environment> <super>ASN1.SingleConstraintCombination</super> <private>false</private> none except <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.ExceptConstraint
An Asn1ConstraintExcept represents a constraint that is satisfied by any value that satisfies the 'constraint' and fails to satisfy the 'except'. Instance Variables: except <Asn1Constraint> the 'except' constraint
</comment> <class> <name>AlphabetConstraint</name> <environment>ASN1</environment> <super>ASN1.SingleConstraintCombination</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.AlphabetConstraint
An Asn1ConstraintAlphabet represents a constraint on the alphabet used within a string type. Its enclosed subconstraint is usually a union of character values. The constraint is satisfied by strings in which all characters are members of the union.
</comment> <class> <name>AllExceptConstraint</name> <environment>ASN1</environment> <super>ASN1.SingleConstraintCombination</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.AllExceptConstraint
An Asn1ConstraintAllExcept is fulfilled by all objects that fail to satisfy its enclosed subconstraint.
</comment> <class> <name>SizeConstraint</name> <environment>ASN1</environment> <super>ASN1.Constraint</super> <private>false</private> none lower upper <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.SizeConstraint
An Asn1ConstraintSize is satisfied by any object with a size >= 'lower' and <= 'upper'. Instance Variables: lower <Integer> the lower bound upper <Integer> the upper bound
</comment> <class> <name>WithComponentConstraint</name> <environment>ASN1</environment> <super>ASN1.SingleConstraintCombination</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.WithComponentConstraint
Asn1ConstraintWithComponent is a constraint for the SET OF and SEQUENCE OF types. It is satisfied if each element of the set or sequence satisfies the 'constraint'.
</comment> <class> <name>TypeInclusionConstraint</name> <environment>ASN1</environment> <super>ASN1.Constraint</super> <private>false</private> none type <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.TypeInclusionConstraint
A Asn1ConstraintOfType is satisfied by any value that satisfies the constraints of the 'type'. Instance Variables: type <Asn1Type> the type used to express the constraint
</comment> <class> <name>ValueRangeConstraint</name> <environment>ASN1</environment> <super>ASN1.Constraint</super> <private>false</private> none lower lowerOpen upper upperOpen <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Constraints</package> </attributes> </class> <comment> ASN1.ValueRangeConstraint
An Asn1ConstraintValueRange is satisfied by objects that satisfy the range. Instance Variables: lower <Magnitude> the lower bound lowerOpen <Boolean> 'true' if the range is 'open' at the lower bound upper <Magnitude> the upper bound upperOpen <Boolean> 'true' if the range is 'open' at the upper bound
</comment> <methods> ASN1.Constraint <category>construction</category>
& aConstraint ^ConstraintIntersection with: self with: aConstraint
- aConstraint ^ExceptConstraint with: self except: aConstraint
not ^AllExceptConstraint with: self
| aConstraint ^ConstraintUnion with: self with: aConstraint
</methods> <methods> ASN1.Constraint <category>private</category>
privatePermits: anObject self subclassResponsibility
</methods> <methods> ASN1.Constraint <category>printing</category>
printOn: aStream self shortPrintOn: aStream
shortPrintOn: aStream aStream nextPutAll: self class printString
</methods> <methods> ASN1.Constraint <category>initialize-release</category>
initialize "... intentionally null."
</methods> <methods> ASN1.Constraint <category>operational api</category>
permits: anObject "Answers whether the constraint permits anObject." ^[ self privatePermits: anObject ] on: Error do: [ :ex | ^false ]
</methods> <methods> ASN1.Constraint <category>testing</category>
isNull ^false
</methods> <methods> ASN1.Constraint <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^anObject class == self class
</methods> <methods> ASN1.Constraint class <category>construction</category>
block: aBlock ^BlockConstraint with: aBlock
from: bottom to: top ^ValueRangeConstraint lower: bottom upper: top
null ^NullConstraint default
size: anInteger ^SizeConstraint size: anInteger
type: aType ^TypeInclusionConstraint with: aType
value: anObject ^SingleValueConstraint with: anObject
values: aCollection ^ValueUnionConstraint withAll: aCollection
</methods> <methods> ASN1.Constraint class <category>instance creation</category>
new ^super new initialize
</methods> <methods> ASN1.NullConstraint <category>private</category>
privatePermits: anObject ^true
</methods> <methods> ASN1.NullConstraint <category>printing</category>
shortPrintOn: aStream aStream nextPutAll: 'Null'
</methods> <methods> ASN1.NullConstraint <category>testing</category>
isNull ^true
</methods> <methods> ASN1.NullConstraint <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^anObject == self
</methods> <methods> ASN1.NullConstraint class <category>instance creation</category>
default ^self new
new ^( default isNil ) ifTrue: [ default := super new ] ifFalse: [ default ]
</methods> <methods> ASN1.SingleValueConstraint <category>printing</category>
shortPrintOn: aStream aStream print: self value
</methods> <methods> ASN1.SingleValueConstraint <category>accessing</category>
value ^value
value: aLiteralOrAsn1Constraint value := aLiteralOrAsn1Constraint
</methods> <methods> ASN1.SingleValueConstraint <category>private</category>
privatePermits: anObject ^[ ( value = anObject ) or: [ anObject permits: anObject ] ] on: Error do: [ :ex | false ]
</methods> <methods> ASN1.SingleValueConstraint <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^( super equals: anObject ) and: [ anObject value = self value ]
</methods> <methods> ASN1.SingleValueConstraint class <category>instance creation</category>
with: anObject ^( self new ) value: anObject; yourself
</methods> <methods> ASN1.ValueUnionConstraint <category>accessing</category>
values ^values
values: aCollection values := aCollection
</methods> <methods> ASN1.ValueUnionConstraint <category>private</category>
privatePermits: anObject ^values includes: anObject
</methods> <methods> ASN1.ValueUnionConstraint <category>printing</category>
printValue: anObject on: aStream anObject class = Character ifTrue: [ ^aStream nextPut: anObject ]. anObject printOn: aStream
shortPrintOn: aStream self values isCharacters ifTrue: [ ^aStream nextPut: $"; nextPutAll: self values; nextPut: $" ]. self values do: [ :v | aStream nextPut: $". self printValue: v on: aStream. aStream nextPut: $" ] separatedBy: [ aStream nextPut: $| ]
</methods> <methods> ASN1.ValueUnionConstraint <category>initialize-release</category>
initialize values := Set new: 7
</methods> <methods> ASN1.ValueUnionConstraint <category>configuration api</category>
addValue: anObject values add: anObject
</methods> <methods> ASN1.ValueUnionConstraint <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^( super equals: anObject ) and: [ anObject values = self values ]
</methods> <methods> ASN1.ValueUnionConstraint class <category>instance creation</category>
with: aValue ^( self new ) addValue: aValue; yourself
with: aValue1 with: aValue2 ^( self new ) addValue: aValue1; addValue: aValue2; yourself
with: aValue1 with: aValue2 with: aValue3 ^( self new ) addValue: aValue1; addValue: aValue2; addValue: aValue3; yourself
with: aValue1 with: aValue2 with: aValue3 with: aValue4 ^( self new ) addValue: aValue1; addValue: aValue2; addValue: aValue3; addValue: aValue4; yourself
withAll: aCollection | n | n := self new. n values addAll: aCollection. ^n
</methods> <methods> ASN1.MultipleConstraintCombination <category>initialize-release</category>
initialize constraints := OrderedCollection new
</methods> <methods> ASN1.MultipleConstraintCombination <category>printing</category>
shortPrintOn: aStream self constraints do: [ :c | aStream nextPut: $(. c ifNil: [ aStream nextPutAll: 'nil' ] ifNotNil: [ c shortPrintOn: aStream ]. aStream nextPut: $) ] separatedBy: [ aStream space; nextPut: self operatorCharacter; space ]
</methods> <methods> ASN1.MultipleConstraintCombination <category>accessing</category>
constraints ^constraints
constraints: aCollection constraints := aCollection
</methods> <methods> ASN1.MultipleConstraintCombination <category>configuration api</category>
addConstraint: anAsn1Constraint constraints add: anAsn1Constraint
</methods> <methods> ASN1.MultipleConstraintCombination <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^ self == anObject "Do not waste time comparing structure if we're identical." or: [ ( super equals: anObject ) and: [ anObject constraints allSatisfy: [ :c1 | self constraints anySatisfy: [ :c2 | c2 equals: c1 ] ] ] ]
</methods> <methods> ASN1.MultipleConstraintCombination class <category>instance creation</category>
with: anAsn1Constraint ^( self new ) addConstraint: anAsn1Constraint; yourself
with: anAsn1Constraint1 with: anAsn1Constraint2 ^( self new ) addConstraint: anAsn1Constraint1; addConstraint: anAsn1Constraint2; yourself
with: anAsn1Constraint1 with: anAsn1Constraint2 with: anAsn1Constraint3 ^( self new ) addConstraint: anAsn1Constraint1; addConstraint: anAsn1Constraint2; addConstraint: anAsn1Constraint3; yourself
with: anAsn1Constraint1 with: anAsn1Constraint2 with: anAsn1Constraint3 with: anAsn1Constraint4 ^( self new ) addConstraint: anAsn1Constraint1; addConstraint: anAsn1Constraint2; addConstraint: anAsn1Constraint3; addConstraint: anAsn1Constraint4; yourself
withAll: aSequenceableCollection "... to ensure ordering, go out of the way to ensure aSequenceableCollection is one." | n | n := self new. 1 to: aSequenceableCollection size do: [ :x | n addConstraint: ( aSequenceableCollection at: x ) ]. ^n
</methods> <methods> ASN1.ConstraintIntersection <category>private</category>
privatePermits: anObject constraints do: [ :c | ( c privatePermits: anObject ) ifFalse: [ ^false ] ]. ^true
</methods> <methods> ASN1.ConstraintIntersection <category>printing</category>
operatorCharacter ^$^
</methods> <methods> ASN1.ConstraintIntersection <category>construction</category>
& aConstraint ^self addConstraint: aConstraint
</methods> <methods> ASN1.ConstraintUnion <category>private</category>
privatePermits: anObject constraints do: [ :c | ( c privatePermits: anObject ) ifTrue: [ ^true ] ]. ^false
</methods> <methods> ASN1.ConstraintUnion <category>printing</category>
operatorCharacter ^$|
</methods> <methods> ASN1.ConstraintUnion <category>construction</category>
| aConstraint ^self addConstraint: aConstraint
</methods> <methods> ASN1.BlockConstraint <category>accessing</category>
blockClosure ^blockClosure
blockClosure: aBlockClosure blockClosure := aBlockClosure
</methods> <methods> ASN1.BlockConstraint <category>printing</category>
shortPrintOn: aStream blockClosure printOn: aStream
</methods> <methods> ASN1.BlockConstraint <category>private</category>
privatePermits: anObject ^blockClosure value: anObject
</methods> <methods> ASN1.BlockConstraint <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^( super equals: anObject ) and: [ anObject blockClosure = self blockClosure ]
</methods> <methods> ASN1.BlockConstraint class <category>instance creation</category>
with: aBlockClosure ^( self new ) blockClosure: aBlockClosure; yourself
</methods> <methods> ASN1.SingleConstraintCombination <category>accessing</category>
constraint ^constraint
constraint: anAsn1Constraint constraint := anAsn1Constraint
</methods> <methods> ASN1.SingleConstraintCombination <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^ self == anObject "Do not waste time comparing structure if we're identical." or: [ ( super equals: anObject ) and: [ anObject constraint equals: self constraint ] ]
</methods> <methods> ASN1.SingleConstraintCombination class <category>instance creation</category>
with: anAsn1Constraint ^( self new ) constraint: anAsn1Constraint; yourself
</methods> <methods> ASN1.ExceptConstraint <category>accessing</category>
except ^except
except: anAsn1Constraint except := anAsn1Constraint
</methods> <methods> ASN1.ExceptConstraint <category>private</category>
privatePermits: anObject ^( constraint privatePermits: anObject ) and: [ ( except privatePermits: anObject ) not ]
</methods> <methods> ASN1.ExceptConstraint <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^ self == anObject "Do not waste time comparing structure if we're identical." or: [ ( super equals: anObject ) and: [ anObject except equals: self except ] ]
</methods> <methods> ASN1.ExceptConstraint class <category>instance creation</category>
with: anAsn1Constraint1 except: anAsn1Constraint2 ^( self new ) constraint: anAsn1Constraint1; except: anAsn1Constraint2; yourself
</methods> <methods> ASN1.AlphabetConstraint <category>private</category>
privatePermits: anObject ( anObject isKindOf: CharacterArray ) ifFalse: [ ^false ]. anObject do: [ :character | ( constraint privatePermits: character ) ifFalse: [ ^false ] ]. ^true
</methods> <methods> ASN1.AlphabetConstraint <category>printing</category>
shortPrintOn: aStream aStream nextPutAll: 'FROM ('. self constraint shortPrintOn: aStream. aStream nextPut: $)
</methods> <methods> ASN1.AllExceptConstraint <category>private</category>
privatePermits: anObject ^( constraint privatePermits: anObject ) not
</methods> <methods> ASN1.SizeConstraint <category>accessing</category>
lower ^lower
lower: anInteger lower := anInteger
upper ^upper
upper: anInteger upper := anInteger
</methods> <methods> ASN1.SizeConstraint <category>printing</category>
shortPrintOn: aStream aStream nextPutAll: 'SIZE ('; print: self lower. self upper = self lower ifFalse: [ aStream nextPutAll: '..'; print: self upper ]. aStream nextPut: $)
</methods> <methods> ASN1.SizeConstraint <category>private</category>
privatePermits: anObject | s | s := anObject size. ^( s >= lower ) and: [ s <= upper ]
</methods> <methods> ASN1.SizeConstraint <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^( super equals: anObject ) and: [ ( anObject lower = self lower ) and: [ anObject upper = self upper ] ]
</methods> <methods> ASN1.SizeConstraint class <category>instance creation</category>
lower: anInteger1 upper: anInteger2 ^( super new ) lower: anInteger1; upper: anInteger2; yourself
size: anInteger ^( super new ) lower: anInteger; upper: anInteger; yourself
</methods> <methods> ASN1.WithComponentConstraint <category>private</category>
privatePermits: anObject anObject do: [ :e | ( constraint privatePermits: e ) ifFalse: [ ^false ] ]. ^true
</methods> <methods> ASN1.TypeInclusionConstraint <category>private</category>
privatePermits: anObject ^type permits: anObject
</methods> <methods> ASN1.TypeInclusionConstraint <category>accessing</category>
type ^type
type: anAsn1Type type := anAsn1Type
</methods> <methods> ASN1.TypeInclusionConstraint <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^ self == anObject "Do not waste time comparing structure if we're identical." or: [ ( super equals: anObject ) and: [ anObject type equals: self type ] ]
</methods> <methods> ASN1.TypeInclusionConstraint class <category>instance creation</category>
with: anAsn1Type ^( self new ) type: anAsn1Type; yourself
</methods> <methods> ASN1.ValueRangeConstraint <category>private</category>
privatePermits: anObject ^( lowerOpen ifTrue: [ lower < anObject ] ifFalse: [ lower <= anObject ] ) and: [ upperOpen ifTrue: [ anObject < upper ] ifFalse: [ anObject <= upper ] ]
</methods> <methods> ASN1.ValueRangeConstraint <category>accessing</category>
lower ^lower
lower: anObject lower := anObject
lowerOpen ^lowerOpen
lowerOpen: aBoolean lowerOpen := aBoolean
upper ^upper
upper: anObject upper := anObject
upperOpen ^upperOpen
upperOpen: aBoolean upperOpen := aBoolean
</methods> <methods> ASN1.ValueRangeConstraint <category>initialize-release</category>
initialize lowerOpen := upperOpen := false
</methods> <methods> ASN1.ValueRangeConstraint <category>printing</category>
shortPrintOn: aStream aStream print: self lower. self lowerOpen ifTrue: [ aStream nextPut: $< ]. aStream nextPutAll: '..'. self upperOpen ifTrue: [ aStream nextPut: $< ]. aStream print: self upper
</methods> <methods> ASN1.ValueRangeConstraint <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^( super equals: anObject ) and: [ ( anObject lower = self lower ) and: [ ( anObject upper = self upper ) and: [ ( anObject lowerOpen = self lowerOpen ) and: [ anObject upperOpen = self upperOpen ] ] ] ]
</methods> <methods> ASN1.ValueRangeConstraint class <category>instance creation</category>
lower: anObject1 lowerOpen: aBoolean1 upper: anObject2 upperOpen: aBoolean2 ^( self new ) lower: anObject1; lowerOpen: aBoolean1; upper: anObject2; upperOpen: aBoolean2; yourself
lower: anObject1 upper: anObject2 ^( self new ) lower: anObject1; upper: anObject2; yourself
</methods> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class>