Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions 3 Seminar 6/code/Lambda/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions 1 Seminar 6/code/Lambda/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions 6 Seminar 6/code/Lambda/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions 8 Seminar 6/code/Lambda/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions 6 Seminar 6/code/Lambda/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions 11 Seminar 6/code/Lambda/Lambda.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
9 changes: 9 additions & 0 deletions 9 Seminar 6/code/Lambda/src/FuncInterface.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@FunctionalInterface
public interface FuncInterface {
//public abstract boolean canRun();
void run();
public static void runFast() {}
public default void runAgain() {

}
}
29 changes: 29 additions & 0 deletions 29 Seminar 6/code/Lambda/src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import java.util.*;

public class Main {
public static void main(String[] args) {
List<String> names = Arrays.asList("name 1", "Ivan", "Gosho", "Toshok", "Van");
Map<String, Integer> grades = new HashMap<>();
grades.put("Ivan", 2);
grades.put("Yordan", 6);

names.stream().parallel().filter(n -> n.contains("name")).sorted().forEach(System.out::println);
names.stream().forEach(n -> System.out.println(n));

List<String> names2 = new ArrayList<>(Arrays.asList("Ivan", "Gosho", "Toshok", "Van"));
names2.removeIf(n -> n.contains("I"));
names2.forEach(n -> System.out.println(n));

grades.forEach((String key, Integer value) -> { System.out.println(key + " " + value); } );

//"Ivan", "Gosho" -> 4, 5

// doSth((e) -> { String f = ""; return "Poof"; });
//n -> ""
//n -> {return ""; }
}

// private static void doSth(Object a) {
// return "dasdasd";
// }
}
3 changes: 3 additions & 0 deletions 3 Seminar 6/code/Problem6/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions 1 Seminar 6/code/Problem6/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions 6 Seminar 6/code/Problem6/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions 8 Seminar 6/code/Problem6/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions 6 Seminar 6/code/Problem6/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions 11 Seminar 6/code/Problem6/Problem6.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
14 changes: 14 additions & 0 deletions 14 Seminar 6/code/Problem6/src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import java.util.Arrays;
import java.util.List;

public class Main {
public static void main(String[] args) {
List<String> names = Arrays.asList("name 1", "Ivan", "Gosho", "Toshok", "Van");

//filter out names containing "name"
names.stream().filter(n -> !n.contains("name")).forEach(System.out::println);

//sort by length
names.stream().filter(n -> !n.contains("name")).sorted((n1, n2) -> n1.length() - n2.length() ).forEach(System.out::println);
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.