-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from africanmathsinitiative/master
updating branch
- Loading branch information
Showing
15 changed files
with
1,653 additions
and
745 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
Public Class Condition | ||
Private bIsParameterValues As Boolean = False | ||
Private bIsParameterPresenet As Boolean = False | ||
Private bIsFunctionNames As Boolean = False | ||
Private strParameterName As String = "" | ||
Private lstValues As List(Of String) = New List(Of String) | ||
|
||
Public Sub SetParameterPresentName(strParamName As String) | ||
strParameterName = strParamName | ||
bIsParameterPresenet = True | ||
bIsParameterValues = False | ||
bIsFunctionNames = False | ||
End Sub | ||
|
||
Public Sub SetParameterValues(strParamName As String, lstParamValues As List(Of String)) | ||
strParameterName = strParamName | ||
lstValues = lstParamValues | ||
bIsParameterValues = True | ||
bIsParameterPresenet = False | ||
bIsFunctionNames = False | ||
End Sub | ||
|
||
Public Sub SetParameterValues(strParamName As String, strParamValues As String) | ||
SetParameterValues(strParameterName, New List(Of String)({strParamValues})) | ||
End Sub | ||
|
||
Public Sub SetFunctionName(strFuncName As String) | ||
SetFunctionNamesMultiple(New List(Of String)({strFuncName})) | ||
End Sub | ||
|
||
Public Sub SetFunctionNamesMultiple(lstFuncNames As List(Of String)) | ||
lstValues = lstFuncNames | ||
bIsFunctionNames = True | ||
bIsParameterValues = False | ||
bIsParameterPresenet = False | ||
End Sub | ||
|
||
Public Function IsSatisfied(clsRCode As RCodeStructure) As Boolean | ||
Dim clsTempParam As RParameter | ||
Dim clsTempFunc As RFunction | ||
|
||
If bIsParameterValues Then | ||
clsTempParam = clsRCode.GetParameter(strParameterName) | ||
Return (clsTempParam IsNot Nothing AndAlso clsTempParam.bIsString AndAlso clsTempParam.strArgumentValue IsNot Nothing AndAlso lstValues.Contains(clsRCode.GetParameter(strParameterName).strArgumentValue)) | ||
ElseIf bIsParameterPresenet Then | ||
Return (clsRCode.ContainsParameter(strParameterName)) | ||
ElseIf bIsFunctionNames Then | ||
If TypeOf clsRCode Is RFunction Then | ||
clsTempFunc = CType(clsRCode, RFunction) | ||
Return lstValues.Contains(clsTempFunc.strRCommand) | ||
Else | ||
Return False | ||
End If | ||
Else | ||
Return True | ||
End If | ||
End Function | ||
End Class |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.