Permalink
Browse files

Adding methods for completness.

  • Loading branch information...
jsebasct committed Oct 3, 2013
1 parent e102efb commit 74794cedec21fd0d569cba5b90d29c170ac95a45
View
@@ -1,3 +1,3 @@
# ignore some directories
-TimeZones/TimeZones.xcodeproj/project.xcworkspace/
-TimeZones/TimeZones.xcodeproj/xcuserdata/
+ADNunit/ADNunit.xcodeproj/project.xcworkspace/
+*/*.xcodeproj/xcuserdata/
@@ -23,6 +23,7 @@
B84D70DF17FD8088006B87C1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B84D70BA17FD8087006B87C1 /* Foundation.framework */; };
B84D70E717FD8088006B87C1 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B84D70E517FD8088006B87C1 /* InfoPlist.strings */; };
B84D70EA17FD8088006B87C1 /* ADNunitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B84D70E917FD8088006B87C1 /* ADNunitTests.m */; };
+ B84D70F617FD825A006B87C1 /* ADNModel.m in Sources */ = {isa = PBXBuildFile; fileRef = B84D70F517FD825A006B87C1 /* ADNModel.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -58,6 +59,8 @@
B84D70E617FD8088006B87C1 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
B84D70E817FD8088006B87C1 /* ADNunitTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ADNunitTests.h; sourceTree = "<group>"; };
B84D70E917FD8088006B87C1 /* ADNunitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ADNunitTests.m; sourceTree = "<group>"; };
+ B84D70F417FD825A006B87C1 /* ADNModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADNModel.h; path = model/ADNModel.h; sourceTree = "<group>"; };
+ B84D70F517FD825A006B87C1 /* ADNModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADNModel.m; path = model/ADNModel.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -117,6 +120,7 @@
B84D70BE17FD8087006B87C1 /* ADNunit */ = {
isa = PBXGroup;
children = (
+ B84D70F317FD823B006B87C1 /* model */,
B84D70C717FD8087006B87C1 /* ADNAppDelegate.h */,
B84D70C817FD8087006B87C1 /* ADNAppDelegate.m */,
B84D70D017FD8088006B87C1 /* ADNViewController.h */,
@@ -160,6 +164,15 @@
name = "Supporting Files";
sourceTree = "<group>";
};
+ B84D70F317FD823B006B87C1 /* model */ = {
+ isa = PBXGroup;
+ children = (
+ B84D70F417FD825A006B87C1 /* ADNModel.h */,
+ B84D70F517FD825A006B87C1 /* ADNModel.m */,
+ );
+ name = model;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -274,6 +287,7 @@
B84D70C517FD8087006B87C1 /* main.m in Sources */,
B84D70C917FD8087006B87C1 /* ADNAppDelegate.m in Sources */,
B84D70D217FD8088006B87C1 /* ADNViewController.m in Sources */,
+ B84D70F617FD825A006B87C1 /* ADNModel.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -383,6 +397,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ADNunit/ADNunit-Prefix.pch";
INFOPLIST_FILE = "ADNunit/ADNunit-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -394,6 +409,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ADNunit/ADNunit-Prefix.pch";
INFOPLIST_FILE = "ADNunit/ADNunit-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -402,7 +418,6 @@
B84D70F117FD8088006B87C1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ADNunit.app/ADNunit";
FRAMEWORK_SEARCH_PATHS = (
"\"$(SDKROOT)/Developer/Library/Frameworks\"",
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
@@ -411,15 +426,13 @@
GCC_PREFIX_HEADER = "ADNunit/ADNunit-Prefix.pch";
INFOPLIST_FILE = "ADNunitTests/ADNunitTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
- TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = octest;
};
name = Debug;
};
B84D70F217FD8088006B87C1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ADNunit.app/ADNunit";
FRAMEWORK_SEARCH_PATHS = (
"\"$(SDKROOT)/Developer/Library/Frameworks\"",
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
@@ -428,7 +441,6 @@
GCC_PREFIX_HEADER = "ADNunit/ADNunit-Prefix.pch";
INFOPLIST_FILE = "ADNunitTests/ADNunitTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
- TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = octest;
};
name = Release;
@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>1.0</string>
+ <string>0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -0,0 +1,24 @@
+//
+// ADNModel.h
+// ADNunit
+//
+// Created by Sebastian Cruz on 10/3/13.
+// Copyright (c) 2013 PeopleSoft. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface ADNModel : NSObject
+
++ (NSInteger)getLength:(NSString *)dna;
++ (NSInteger)countNucleotides:(NSString *)dna nucleo:(NSString *)nucleotide;
+
++ (BOOL)isValidSequence:(NSString *)dna;
++ (BOOL)isLonger:(NSString *)dna1 than:(NSString *)dna2;
++ (BOOL)containsSequence:(NSString *)dn1 withDNA:(NSString *)dna2;
+
++ (NSString *)getComplement:(NSString *)nucleotide;
++ (NSString *)getComplementarySequence:(NSString *)dna;
++ (NSString *)insertSequence:(NSString *)dna1 withDNA:(NSString *)dna2 atIndex:(NSInteger)index;
+
+@end
@@ -0,0 +1,114 @@
+//
+// ADNModel.m
+// ADNunit
+//
+// Created by Sebastian Cruz on 10/3/13.
+// Copyright (c) 2013 PeopleSoft. All rights reserved.
+//
+
+#import "ADNModel.h"
+
+@implementation ADNModel
+
+// Returns the length of the DNA sequence |dna|
+//
+// [ADNModel getLength:@"ATGCAT"]
+// 6
+//
+// [ADNModel getLength@"ATCG"]
+// 4
+//
++ (NSInteger)getLength:(NSString *)dna
+{
+ return 0;
+}
+
+// Return |YES| if and only if DNA sequence |dna1| is longer than
+// DNA sequence |dna2|
+//
+// [isLonger:@"ATCG" than:@"AT"]
+// YES
+// [isLonger:@"ATCG" than:@"ATCGGA"]
+// NO
+//
++ (BOOL)isLonger:(NSString *)dna1 than:(NSString *)dna2
+{
+ return YES;
+}
+
+// Return the number of ocurrences of nucleotide in the DNA sequence |dna|
+//
+// countNucleotides:@"ATCGGC" nucleo:@"G"
+// 2
+//
+// countNucleotides:@"ATCTA" nucleo:@"G"
+// 0
+//
++ (NSInteger)countNucleotides:(NSString *)dna nucleo:(NSString *)nucleotide
+{
+ return 0;
+}
+
+// Return YES if and only if DNA sequence |dna2| ocurrs in the DNA sequence |dna1|
+//
+// [containsSequence:@"ATCGGC" withDNA:@"GG"]
+// YES
+//
+// [containsSequence:@"ATCGGC" withDNA:@"GT"]
+// NO
+//
++ (BOOL)containsSequence:(NSString *)dn1 withDNA:(NSString *)dna2
+{
+ return NO;
+}
+
+// Returns YES if |dna| is a valid sequence
+//
+// [isValidSequence:@"ATC"]
+// YES
+//
+// [isValidSequence:@"atc"]
+// NO
+// [isValidSequence:@""]
+// NO
+// [isValidSequence:@"ATGCX"]
+// NO
+//
++ (BOOL)isValidSequence:(NSString *)dna
+{
+ return NO;
+}
+
+// Return the dna sequence obtained by inserting the DNA sequence |dna2|
+// into the first DNA sequence |dna1| at index |index|
+//
+// [insertSequence:@"CCGG" withDNA:@"AT", 2]
+// CCATGG
+//
++ (NSString *)insertSequence:(NSString *)dna1 withDNA:(NSString *)dna2 atIndex:(NSInteger)index
+{
+ return @"";
+}
+
+// Returns the |nucleotide's| complement
+// [getComplement:@"A"]
+// T
+// [getComplement:@"T"]
+// A
+//
++ (NSString *)getComplement:(NSString *)nucleotide
+{
+ return @"";
+}
+
+// Returns the DNA sequence complementary to DNA sequence |dna|
+//
+// [getComplementarySequence:@"AT"]
+// TA
+//
++ (NSString *)getComplementarySequence:(NSString *)dna
+{
+ return @"";
+}
+
+@end

0 comments on commit 74794ce

Please sign in to comment.