diff --git a/src/Famix-CallGraphs-Properties/FamixAbstractCallGraphNode.extension.st b/src/Famix-CallGraphs-Properties/FamixAbstractCallGraphNode.extension.st index 68072f4..cb73d25 100644 --- a/src/Famix-CallGraphs-Properties/FamixAbstractCallGraphNode.extension.st +++ b/src/Famix-CallGraphs-Properties/FamixAbstractCallGraphNode.extension.st @@ -5,61 +5,3 @@ FamixAbstractCallGraphNode >> additionalProperties [ ^ FamixCallGraphAdditionalProperties current at: self ifAbsent: [ nil ] ] - -{ #category : '*Famix-CallGraphs-Properties' } -FamixCallGraphNode >> additionalPropertyNamed: aString [ - - ^ (FamixCallGraphAdditionalProperties current at: self) at: aString -] - -{ #category : '*Famix-CallGraphs-Properties' } -FamixCallGraphNode >> additionalPropertyNamed: aString ifAbsent: aBlock [ - - ^ FamixCallGraphAdditionalProperties current - at: self - ifPresent: [ :dic | dic at: aString ifAbsent: aBlock ] - ifAbsent: aBlock -] - -{ #category : '*Famix-CallGraphs-Properties' } -FamixCallGraphNode >> additionalPropertyNamed: aString ifPresent: aBlock [ - - ^ FamixCallGraphAdditionalProperties current - at: self - ifPresent: [ :dic | dic at: aString ifPresent: aBlock ] - ifAbsent: [ nil ] -] - -{ #category : '*Famix-CallGraphs-Properties' } -FamixCallGraphNode >> additionalPropertyNamed: aString ifPresent: aBlock ifAbsent: anotherBlock [ - - ^ FamixCallGraphAdditionalProperties current - at: self - ifPresent: [ :dic | - dic - at: aString - ifPresent: aBlock - ifAbsent: anotherBlock ] - ifAbsent: anotherBlock -] - -{ #category : '*Famix-CallGraphs-Properties' } -FamixCallGraphNode >> additionalPropertyNamed: aString put: aValue [ - - ^ (FamixCallGraphAdditionalProperties current at: self ifAbsentPut: [ Dictionary new ]) at: aString put: aValue -] - -{ #category : '*Famix-CallGraphs-Properties' } -FamixCallGraphNode >> removeAdditionalPropertyNamed: aString [ - - ^ (FamixCallGraphAdditionalProperties current at: self) removeKey: aString -] - -{ #category : '*Famix-CallGraphs-Properties' } -FamixCallGraphNode >> removeAdditionalPropertyNamed: aString ifAbsent: aBlock [ - - ^ FamixCallGraphAdditionalProperties current - at: self - ifPresent: [ :dict | dict removeKey: aString ifAbsent: aBlock ] - ifAbsent: aBlock -] diff --git a/src/Famix-CallGraphs-Properties/FamixCallGraph.extension.st b/src/Famix-CallGraphs-Properties/FamixCallGraph.extension.st new file mode 100644 index 0000000..9d79c08 --- /dev/null +++ b/src/Famix-CallGraphs-Properties/FamixCallGraph.extension.st @@ -0,0 +1,8 @@ +Extension { #name : 'FamixCallGraph' } + +{ #category : '*Famix-CallGraphs-Properties' } +FamixCallGraph >> allNodesWithAdditionalProperties [ + "Return every nodes with additionnal properties" + + ^ self allNodes select: [ :each | each additionalProperties isNotNil ] +] diff --git a/src/Famix-CallGraphs-Properties/FamixCallGraphNode.extension.st b/src/Famix-CallGraphs-Properties/FamixCallGraphNode.extension.st new file mode 100644 index 0000000..1def90e --- /dev/null +++ b/src/Famix-CallGraphs-Properties/FamixCallGraphNode.extension.st @@ -0,0 +1,59 @@ +Extension { #name : 'FamixCallGraphNode' } + +{ #category : '*Famix-CallGraphs-Properties' } +FamixCallGraphNode >> additionalPropertyNamed: aString [ + + ^ (FamixCallGraphAdditionalProperties current at: self) at: aString +] + +{ #category : '*Famix-CallGraphs-Properties' } +FamixCallGraphNode >> additionalPropertyNamed: aString ifAbsent: aBlock [ + + ^ FamixCallGraphAdditionalProperties current + at: self + ifPresent: [ :dic | dic at: aString ifAbsent: aBlock ] + ifAbsent: aBlock +] + +{ #category : '*Famix-CallGraphs-Properties' } +FamixCallGraphNode >> additionalPropertyNamed: aString ifPresent: aBlock [ + + ^ FamixCallGraphAdditionalProperties current + at: self + ifPresent: [ :dic | dic at: aString ifPresent: aBlock ] + ifAbsent: [ nil ] +] + +{ #category : '*Famix-CallGraphs-Properties' } +FamixCallGraphNode >> additionalPropertyNamed: aString ifPresent: aBlock ifAbsent: anotherBlock [ + + ^ FamixCallGraphAdditionalProperties current + at: self + ifPresent: [ :dic | + dic + at: aString + ifPresent: aBlock + ifAbsent: anotherBlock ] + ifAbsent: anotherBlock +] + +{ #category : '*Famix-CallGraphs-Properties' } +FamixCallGraphNode >> additionalPropertyNamed: aString put: aValue [ + + ^ (FamixCallGraphAdditionalProperties current at: self ifAbsentPut: [ Dictionary new ]) at: aString put: aValue +] + +{ #category : '*Famix-CallGraphs-Properties' } +FamixCallGraphNode >> removeAdditionalPropertyNamed: aString [ + + ^ (FamixCallGraphAdditionalProperties current at: self) removeKey: aString +] + +{ #category : '*Famix-CallGraphs-Properties' } +FamixCallGraphNode >> removeAdditionalPropertyNamed: aString ifAbsent: aBlock [ + + ^ FamixCallGraphAdditionalProperties current + at: self + ifPresent: [ :dict | dict removeKey: aString ifAbsent: aBlock ] + ifAbsent: aBlock +]