From 05de203f0c555b6ec69d8634c9784d0e42f24fa4 Mon Sep 17 00:00:00 2001 From: annalinewyork Date: Fri, 29 May 2015 18:17:03 -0400 Subject: [PATCH] submit --- .idea/.name | 1 + .idea/compiler.xml | 23 + .idea/copyright/profiles_settings.xml | 3 + .idea/encodings.xml | 4 + .idea/libraries/lib.xml | 10 + .idea/misc.xml | 281 +++++++ .idea/modules.xml | 8 + .idea/scopes/scope_settings.xml | 5 + .idea/vcs.xml | 6 + .idea/workspace.xml | 730 ++++++++++++++++++ .../Exercises$Child.class | Bin 0 -> 584 bytes .../Exercises$Parent.class | Bin 0 -> 425 bytes .../Exercises.class | Bin 0 -> 355 bytes .../unit-1-bootcamp-assessment/Main.class | Bin 0 -> 1055 bytes .../unit-1-bootcamp-assessment/MyNode.class | Bin 0 -> 1008 bytes .../unit-1-bootcamp-assessment/MyObject.class | Bin 0 -> 1053 bytes .../MyObjectNode.class | Bin 0 -> 963 bytes .../unit-1-bootcamp-assessment/Tests.class | Bin 0 -> 3888 bytes src/Exercises.java | 15 +- src/Main.java | 26 + src/MyNode.java | 19 +- src/MyObject.java | 55 ++ src/MyObjectNode.java | 47 ++ src/Tests.java | 1 + unit-1-bootcamp-assessment.iml | 12 + 25 files changed, 1235 insertions(+), 11 deletions(-) create mode 100644 .idea/.name create mode 100644 .idea/compiler.xml create mode 100644 .idea/copyright/profiles_settings.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/libraries/lib.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/scopes/scope_settings.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 out/production/unit-1-bootcamp-assessment/Exercises$Child.class create mode 100644 out/production/unit-1-bootcamp-assessment/Exercises$Parent.class create mode 100644 out/production/unit-1-bootcamp-assessment/Exercises.class create mode 100644 out/production/unit-1-bootcamp-assessment/Main.class create mode 100644 out/production/unit-1-bootcamp-assessment/MyNode.class create mode 100644 out/production/unit-1-bootcamp-assessment/MyObject.class create mode 100644 out/production/unit-1-bootcamp-assessment/MyObjectNode.class create mode 100644 out/production/unit-1-bootcamp-assessment/Tests.class create mode 100644 src/Main.java create mode 100644 src/MyObject.java create mode 100644 src/MyObjectNode.java create mode 100644 unit-1-bootcamp-assessment.iml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..540cdbc --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +unit-1-bootcamp-assessment \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..a852314 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..d821048 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml new file mode 100644 index 0000000..85d6a10 --- /dev/null +++ b/.idea/libraries/lib.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..63889e6 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Abstraction issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + 1.7 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..8928d91 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..e6aa621 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,730 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1432855768379 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No facets are configured + + + + + + + + + + + + + + + 1.7 + + + + + + + + unit-1-bootcamp-assessment + + + + + + + + 1.7 + + + + + + + + lib + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/unit-1-bootcamp-assessment/Exercises$Child.class b/out/production/unit-1-bootcamp-assessment/Exercises$Child.class new file mode 100644 index 0000000000000000000000000000000000000000..6ac3b7990a475024002e5303847fc7660259f2c7 GIT binary patch literal 584 zcmZutO;5r=6r80kEeHq|QTz%AW57f?c<`X{LNuB*#stHCX%|>i+oTjf{*|6gJop3r zQO36|A`zQ(=e^mPeY5-d_5K0i2s?Qgs99LEux?_*#3n=bR0c9WW6+wd9)sQqJ;AW- z$Ut0A?)xIT<$a$R+X-Fn_jn{#KPB~eB*zR!XC!@(p>P!hBI@{jJQhS(obx9UxssaQ zL~+7kdSN%73G*rprLglSfW@-K74BN4>(SU*K>wuc6EdR6sl^waTRu&8Pi zGD2hj4eXVQ404G;kvZgPEu;c0p+p^JK$%u$J|I*&&Ca|K%v+0dR&CB&nOcttGl^CE kYpo>KTDm>8s@OJG5>qu9wTdF4O)4FA%4pH`>ezzy4dz^FbpQYW literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/Exercises$Parent.class b/out/production/unit-1-bootcamp-assessment/Exercises$Parent.class new file mode 100644 index 0000000000000000000000000000000000000000..0a403bd8bddf4bee046453faead39e93eb9727e5 GIT binary patch literal 425 zcmYjNO;5r=6r6350-|8WkD~_!alD{h2n6FS z&Wp)JpwsO|Gx;j}sWj7moLgXX#-rt^SkxOR0x;$=abMi1GW;!6s^dI>k?a literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/Exercises.class b/out/production/unit-1-bootcamp-assessment/Exercises.class new file mode 100644 index 0000000000000000000000000000000000000000..efcb4daca927102c702736e0684f9740d274c56b GIT binary patch literal 355 zcmYLFO-sW-5Pj1oO`66g#;>#BK|R<*kBXO|AOsbZ-Z$xDx5N!>(&FFpBzW)#_@j!m zX^Fe+o0&InhME1{eE$HL;v_&HiH8FZhaQdyZn{wAoDe=}ElpaAx|X$vW5VEB7^xd} zZj@HdEunvYF(Wu>HJ5}aQ(8W*-g9YQMP4$KWK|)`nJ~)6JJM+uswRxGyANp!#m%n? z!ArF=g}hg`Y}{q8mSQbJ3=t599ZQHUKPiQNn>^)9S@29zmpacW=y>KhS7*VT!zTOa-(EI3B) literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/Main.class b/out/production/unit-1-bootcamp-assessment/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..691b2804c95216edefc7c8a066d00543bd5bb2a7 GIT binary patch literal 1055 zcmaJ<$!^n76g@9VZO6DY&CoIwNDD1a<2FDEQ%V;_LIODy5mc#V^^#brE5{D51L{Ap z;xAajB9Vy15+ptfai0@thALjXcZYL_bDn?y`ThgI7Isw3AuD59!HS9qZpLv7t1{M9 zNXRO7~{M_z@24H=s<3JlV=?b^W(LsZZ0GsK>Gb&Fxnv|Z~}yIHmTx4i05 zBx!mz?(B2l7XBa@3y$m)>S30-?UtyzNjJlS{?0t+A9%sxZlh2MeA{i5!tUH}5I%KI znilX}nxmTK)4l4kRST$JH2COIsN%K#n)Tckd&I@4P0?LL0`m;YKRk_p=^eQud`HGz z4fn9cusFWRZrgV1md^kU_fgdF01t)rNW)`1kx|mHji=O13}Q%})%VvD^d{N85cGzy zmD7{JY6?>AfFaW_u)V@-(jp*5EZ!u35^uFEx6ZI}PRrcHl)>tv(0bqI4oR6AE*$8V zJ7ieW52w{Df!BW)hO|BjqzS2z_vpq9a!c&*kS-&G|35L7agqK=@kKy_V4lt-c?G&j za?GrE!M=v+6rEBSRFEcH>jRL%0(o&P;u1xun5`m)D8+vD5IIOj6X`Bu<~PjrARTle zCzTH3dDem2!G#XA4rYgd t_J$~XNZ}KS@`c3siOZop*}eqiT?uP?xQZnbsEE(FMwZa~I%Oib@fYVR=!5_O literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/MyNode.class b/out/production/unit-1-bootcamp-assessment/MyNode.class new file mode 100644 index 0000000000000000000000000000000000000000..61d2fb37918475a1b73c4417806d572abd753a69 GIT binary patch literal 1008 zcmZuvO-~b16g`ib>E{$mZ9$ZxsOYp+P+6haU^K2;Or&9v}ob z`m^II8Yxhs)$0bDbcKR5*|PMSlz#8fjm9dLnVmql-qrQd$Y#vpNZ~n~jYpFms*{jH zYNt2wTkZ=_mY0q`(yI8ek;SZyt5~%05I1aG#)6Gy$*y35A0*<^%D?V;=e{54PTySS zpOE0+V!%WaDP|_pqi7=og=u0_m_dv==kd%DdCI65t@0PB&rA$l;wdC)k>_bg1Qfz{ za~F_#l9cETBh`kHPWVnVu*mx*T>DdBXGUw3BIAEBnv8GCXP7!ivT_c~IF(|Ed}WBN zq?I!mC$LPx%^{{G5VJnPG@h`CMObW%RTn=ZUOYkE6vipro1v*C?g+G$rj-olag)MV zxZ(}2zK&vOwj9YBnWZqYWP2NwoWw24tP{!7HEw}kzw4gh1$elvzH`-LR$p8QV literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/MyObject.class b/out/production/unit-1-bootcamp-assessment/MyObject.class new file mode 100644 index 0000000000000000000000000000000000000000..54a614d9257d8e184bc6ee05a86afb200b8867c9 GIT binary patch literal 1053 zcmZ`&OK%cU7(I7p7z#pZv7pk2wAC^*5LxI>)5MsVG@*5YY0~ZnoZuh@rGtqZ|A#w& z01HiQG%k#;O#D&CbMIVUX$|2%zQ;M|J2&&^@An@7?xUK9jqMaH?8s#|i92cB#a z0juwy1p@g-*MIBRdw#!DZ$`tg-+3rt`W>dkfq?xe?1$05K+(Bec;Frr=gHs&i*t>z z9~_O&TEXzS-|8vkLEG;g`@>M)bX;9ha0zUXPTv zHOIY7%7XJrLE#EfQj^UJg=jfSqaC~%`91P3G-v_tDVYbY?xGh{b=hX*w_hFluk{4! z=3q2z2TwyeV|FseJ?UZw*WhH3#8L(+qy?5H=_K3?O7H|$W_HIEYHVs=Rf$m)_Udth zax3%mX+?96=!koYZ9cEfH#hhvJy%EtTx|%d%5cr{cESpid(Qg`;Z-kScpDcmKQm-t znQNXvV1vb$6kC@0%P~@p+pvOF-Uy&*ggQwgg9Le8*EDtRGMDhaz#Q`sgG((SfCQ9^ zSfBv~)=*$XYMgI2J~1%gT)48ih#R_jpViU?TMajxODY6zk+7r?igDF+9$U{NaFbQB zkQvtcf=4mdCb72ugC!l24wSI2vEFN4wd!vq%yIP>tPdzxf5M_e(xs2cb2H+I@ePTw uGR{=5Qc{n*Bfnvu_GnXu$PPR_m{U-jPE*4MHp#rjnJpOhF3-1>ljVPikfini literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/MyObjectNode.class b/out/production/unit-1-bootcamp-assessment/MyObjectNode.class new file mode 100644 index 0000000000000000000000000000000000000000..0c08d3d93e0bcd5a5aec4aa634353e0577c5ca5c GIT binary patch literal 963 zcma)4%TC)+5Iq+hCozUVNO+a^t4Ugw1?mdKhKg075+L?YxCEo%NRBDuuV8^Hbbu;(Qc+O+y`p@5AzX5FHqXQc&d1SCEVNJq%78_Y?Dr8$as_TnL!Kqa1 zhj&MvbG@Tr?ekP9)crso-CQ?xcFEWaY zGNxS2pyXms!U7f*+;ksJ$IHbE*KhM-fE+lViFsz9nJJz_>RuuoM%z>zjPUNpUwMu) zMDlo*w4ic!S3O%7yg zKhrdhfzHFiV#-6NKlgOs!yY?D#;$#O#L$zGm_hcunlfYe&Dio%MtpWK*YHcO4RUS1 g!NmtRTpuu>4ED^I^^&VfuG$-1{BI1`l3D8VKl6utod5s; literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/Tests.class b/out/production/unit-1-bootcamp-assessment/Tests.class new file mode 100644 index 0000000000000000000000000000000000000000..d1dbfd9e3a7a356341f83648a4c4e2c8273af630 GIT binary patch literal 3888 zcmbVPX?q*h89if3p3!(59C-uU61<#0N&nmd0;5h})D|kV{H)MP>iErWC zV*7Vwd{@DXD#zbb@qPS2#t$X5A2BV{JtiTR89FB+K2N(vu#W>L0V+3=0M9@ zmSIm-b;mKdKb4zaGVGGc!Jr?)RO<9n$yjvFy5-3Dk%aWwhUJC2U?F!L_*MWk^Mq{5k^GS{j!Zn^g8hqPa4Yq)fTY{@poFateP~eC zuoxs|d3sZHJZV}C6kXf27MQI&nkJl;YhE>O>hOC7y(ZM{^=mdK=oyd3mGNVGTgEBg2^nX2G>@oznnaz{9Z`PLDo-v@O{Eq{ zOaw>116 z|B$gFPI{gEcp5j)=-uV;X`wsUmGf`7gk(rMftTw=w=q92p(hi#)=LvwzpG`ONj_;d zY0$*mX1mjmHuNel!QM>7*uiUX^Ne_bdqu8_UMtzO=2%{LOMFY2K{YMMdr?ml$51q# zN7LaU&zS2s(v7N*WTv7M)<|??6URms4+|_YzOfSaXEsiK%ZhuVMFNsGeNnpP5#@tmPUDhRrv9X7^A{NHj!7^d*6h&`ZC#Qcura zh1d_^5DR~XJK}6Vi_ftq&N0DO!r>6m;{+xE9lU`g0d?e3+N}X8sm_sqA(`r2!6rg( zVe4mZ5Rrmy#I~Ki9oUUKh+=01-@y>yD2{w6zM~<&=ZG#YaH(PP`obeML$Urnhg7C0tj&ucMP8=6&;Ma7n3a0#r_vC#azc3 zFEsSmrnz=2B2P4dN-r~ilKY-o3$&+j1HB}+Zz8^LB9TtKd#F8jNbZ$;+h4=hbfQ-t zpHR~Aw6cONE4cmsE3)*)2mft<2kF^Zs=qiJPi-yECQ{pq>-Y9Y_O4<(o#Ji%pCBXd zk+GlfLDPv*2Px>{(bF{KIKPjwox(k^sKOH4C+QGD(iIwboYD8;q^IRxWO0hV8^E3T zB63uDkgDd{SV+1Xl3vG`SR+Pk^Eitl z@e2BdqdWM&#k~;p`)e~?`!d%?5dVNc6dC7a+%Mw+8M87T}#ReZ-!#O9*X^HDE3Q%*jIVa&J$xIBD;w9WfxJO sK=y%;kUfU4^5AWF*n1B { - private MyNode left; - private MyNode right; - private T data; + + + protected MyNode left; + protected MyNode right; + protected T data; public abstract MyNode getLeft(); @@ -13,15 +15,16 @@ public abstract class MyNode { public abstract T getData(); public abstract void insert(MyNode newNode); - public boolean contains(T someData){ - if(getData()==null && someData == null){ + + public boolean contains(T someData) { + if (getData() == null && someData == null) { return false; } - if(getData()!= null && someData!=null && getData().equals(someData)) { + if (getData() != null && someData != null && getData().equals(someData)) { return true; } - boolean left = getLeft()!=null ? getLeft().contains(someData) : false; - boolean right = getRight()!=null ? getRight().contains(someData) : false; + boolean left = getLeft() != null ? getLeft().contains(someData) : false; + boolean right = getRight() != null ? getRight().contains(someData) : false; return left || right; } diff --git a/src/MyObject.java b/src/MyObject.java new file mode 100644 index 0000000..1dd4310 --- /dev/null +++ b/src/MyObject.java @@ -0,0 +1,55 @@ +import java.util.Objects; + +/** + * Created by c4q-nali on 5/28/15. + */ +public class MyObject { + + String name; + int age; + + public MyObject(String name, int age) { + this.name = name; + this.age = age; + } + + public int getAge() { + return age; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + + if (obj instanceof MyObject) { + if (((MyObject) obj).age == age) { + return Objects.equals(name, ((MyObject) obj).name); +// if (name!=null){ +// return name.equals(((MyObject) obj).name); +// }else if (((MyObject) obj).name!=null){ +// return ((MyObject) obj).name.equals(name); +// }else { +// return true; +// } +// + } + } + + return false; + } +} +// press command and click mouse to see the info of that method. \ No newline at end of file diff --git a/src/MyObjectNode.java b/src/MyObjectNode.java new file mode 100644 index 0000000..90dd491 --- /dev/null +++ b/src/MyObjectNode.java @@ -0,0 +1,47 @@ +import java.util.Objects; + +/** + * Created by c4q-nali on 5/28/15. + */ +public class MyObjectNode extends MyNode { + + @Override + public MyNode getLeft() { + return null; + } + + @Override + public MyNode getRight() { + return null; + } + + @Override + public Object getData() { + return null; + } + + @Override + public void insert(MyNode newNode) { + + } + + public MyObjectNode() { + + } + + public void setLeft(MyNode left) { + this.left = left; + } + + public void setRight(MyNode right) { + this.right = right; + } + + public void setData(Object data) { + this.data = data; + } + + + + +} diff --git a/src/Tests.java b/src/Tests.java index 377c274..1fa57e8 100644 --- a/src/Tests.java +++ b/src/Tests.java @@ -14,6 +14,7 @@ public class Tests { @Test public void test01InheritanceParent() throws Exception { + Exercises.Parent p = new Exercises.Parent(); assertEquals("parent", p.doStuff()); assertThat(p, instanceOf(Exercises.Parent.class)); diff --git a/unit-1-bootcamp-assessment.iml b/unit-1-bootcamp-assessment.iml new file mode 100644 index 0000000..fb8e866 --- /dev/null +++ b/unit-1-bootcamp-assessment.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file