bruh
modified: .gitignore modified: Semester 2/Assignments/labEL2_CalebFontenot/target/labEL2_CalebFontenot-1.0-SNAPSHOT.war modified: Semester 2/Assignments/labEL2_CalebFontenot/target/maven-archiver/pom.properties modified: Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst modified: Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file: Semester 2/Assignments/lab_EL5_CalebFontenot/Printed HTMLs/LambdaAction.html new file: Semester 2/Assignments/lab_EL5_CalebFontenot/Printed HTMLs/index.html modified: Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/java/edu/slcc/asdv/beans/LambdaAction.java modified: Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/webapp/index.xhtml modified: Semester 2/Assignments/lab_EL5_CalebFontenot/target/lab_EL5_CalebFontenot-1.0-SNAPSHOT/index.xhtml new file: Semester 2/ZIPs/lab_EL5_CalebFontenot.zip
This commit is contained in:
@@ -11,35 +11,38 @@
|
||||
{x = 3}: #{x = 3}<br/>
|
||||
{y = x + 5}: #{y = x + 5}<br/>
|
||||
{z = x + y}: #{z = x + y}<br/>
|
||||
|
||||
concatenation operator += {z += x} #{z += x}
|
||||
|
||||
<h3>; semicolon operator</h3>
|
||||
{x = 5; y = 3; z = x + y}: #{x = 5; y = 3; z = x + y}<br/>
|
||||
<h3>lambda expressions and conditional operator</h3>
|
||||
{(x->x+1)(3)}: #{(x->x+1)(3)}<br/>
|
||||
Declaration and use of lambda variables: #{squareOfNumber = ((x) -> x+x); squareOfNumber(4)}<br/>
|
||||
|
||||
use of lambda variable outside the initial {}: #{squareOfNumber(5)}<br/>
|
||||
|
||||
#{min=(x,y) -> (x lt y ? x : y); min(1,2)}<br/>
|
||||
#{min(3, 4)}<br/>
|
||||
|
||||
<h3> call a bean method with EL as lambda expression</h3>
|
||||
|
||||
#{lambdaAction.lambda1(max = (x,y) -> x gt y ? x : y)}<br/>
|
||||
|
||||
<h3> Collections as lambda expression</h3>
|
||||
set: #{set = {10,20,1,44}}<br/>
|
||||
list: #{list = [100,2,20,33]}<br/>
|
||||
map: #{map = {"one":1, "two":3, "four":4}} <br/>
|
||||
sorting a list descending: #{list.stream().sorted((i,j)->i-j).toList()}<br/>
|
||||
sorting a list ascending: #{list.stream().sorted((i,j)->j-i).toList()}<br/>
|
||||
|
||||
<h3>Traversing a lambda collection</h3>
|
||||
<ui:repeat value="#{map.keySet().toArray()}" var="t">
|
||||
<h:outputText value="key:#{t}
|
||||
value: #{map.get(t)}"/><br/>
|
||||
</ui:repeat>
|
||||
|
||||
concatenation operator += {z += x} #{z += x}
|
||||
|
||||
<h3>; semicolon operator</h3>
|
||||
{x = 5; y = 3; z = x + y}: #{x = 5; y = 3; z = x + y}<br/>
|
||||
<h3>lambda expressions and conditional operator</h3>
|
||||
{(x->x+1)(3)}: #{(x->x+1)(3)}<br/>
|
||||
Declaration and use of lambda variables: #{squareOfNumber = ((x) -> x+x); squareOfNumber(4)}<br/>
|
||||
|
||||
use of lambda variable outside the initial {}: #{squareOfNumber(5)}<br/>
|
||||
|
||||
#{min=(x,y) -> (x lt y ? x : y); min(1,2)}<br/>
|
||||
#{min(3, 4)}<br/>
|
||||
|
||||
<h3> call a bean method with EL as lambda expression</h3>
|
||||
|
||||
#{lambdaAction.lambda1(max = (x,y) -> x gt y ? x : y)}<br/>
|
||||
|
||||
<h3> Collections as lambda expression</h3>
|
||||
set: #{set = {10,20,1,44}}<br/>
|
||||
list: #{list = [100,2,20,33]}<br/>
|
||||
map: #{map = {"one":1, "two":3, "four":4}} <br/>
|
||||
sorting a list descending: #{list.stream().sorted((i,j)->i-j).toList()}<br/>
|
||||
sorting a list ascending: #{list.stream().sorted((i,j)->j-i).toList()}<br/>
|
||||
|
||||
<h3>Traversing a lambda collection</h3>
|
||||
<ui:repeat value="#{map.keySet().toArray()}" var="t">
|
||||
<h:outputText value="key:#{t}
|
||||
value: #{map.get(t)}"/><br/>
|
||||
</ui:repeat>
|
||||
<h3> Min of 4</h3>
|
||||
#{lambdaAction.lambda2(min4 = (w, x, y, z) -> (w lt x) ? ((w lt y) ? ((w lt z) ? w : z) : ((y lt z) ? y : z)) : ((x lt y) ? ((x lt z) ? x : z) : ((y lt z) ? y : z)))};
|
||||
|
||||
</h:body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user