diff --git a/.metadata/.lock_info b/.metadata/.lock_info index 78509b3..3d76fad 100644 --- a/.metadata/.lock_info +++ b/.metadata/.lock_info @@ -1,4 +1,4 @@ -#Sat May 09 20:34:12 CEST 2026 +#Sun May 10 01:31:23 CEST 2026 host=DESKTOP-ALBQHEK -process-id=5732 +process-id=13140 user=eslusarz diff --git a/.metadata/.log b/.metadata/.log index c8bf398..c60ca44 100644 --- a/.metadata/.log +++ b/.metadata/.log @@ -488,3 +488,132 @@ This warning can be switched off on the Team > Git > Confirmations and Warnings !ENTRY org.eclipse.e4.ui.workbench 2 0 2026-05-09 20:34:38.769 !MESSAGE Removing HandlerImpl with the "org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CloseDialogHandler" id.It points to the non available "bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CloseDialogHandler" class. Bundle might have been uninstalled +!SESSION 2026-05-10 01:30:19.995 ----------------------------------------------- +eclipse.buildId=4.39.0.20260305-0817 +java.version=21.0.10 +java.vendor=Eclipse Adoptium +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY ch.qos.logback.classic 1 0 2026-05-10 01:31:16.787 +!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized. + +!ENTRY org.eclipse.core.resources 2 10035 2026-05-10 01:31:23.569 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY ch.qos.logback.classic 1 0 2026-05-10 01:31:26.705 +!MESSAGE Logback config file: C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.m2e.logback\logback.2.7.101.20251017-1242.xml + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2026-05-10 01:31:29.507 +!MESSAGE Unable to load class 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler' from bundle '147' +!STACK 0 +java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler cannot be found by org.eclipse.e4.ui.workbench.renderers.swt_0.17.0.v20260131-0926 + at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:570) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:564) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:439) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:195) + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) + at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:663) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:88) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:59) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:276) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:603) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:583) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:185) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298) + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563) + at org.eclipse.equinox.launcher.Main.run(Main.java:1415) + +!ENTRY org.eclipse.egit.ui 2 0 2026-05-10 01:32:02.503 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\eslusarz'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.jdt.ui 4 0 2026-05-10 01:42:30.620 +!MESSAGE AbortCompilation computing hover information in EsercizioParole.java at offset 631 +!STACK 0 +org.eclipse.jdt.internal.compiler.problem.AbortCompilation: + at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:11585) + at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:11975) + at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:11916) + at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:10308) + at org.eclipse.jdt.core.dom.CompilationUnitResolver.parse(CompilationUnitResolver.java:656) + at org.eclipse.jdt.core.dom.CompilationUnitResolver.toCompilationUnit(CompilationUnitResolver.java:1432) + at org.eclipse.jdt.core.dom.CompilationUnitResolver$ECJCompilationUnitResolver.toCompilationUnit(CompilationUnitResolver.java:109) + at org.eclipse.jdt.core.dom.ASTParser.internalCreateASTCached(ASTParser.java:1412) + at org.eclipse.jdt.core.dom.ASTParser.lambda$1(ASTParser.java:1291) + at org.eclipse.jdt.internal.core.JavaModelManager.cacheZipFiles(JavaModelManager.java:5709) + at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1291) + at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:933) + at org.eclipse.jdt.core.manipulation.internal.javadoc.CoreJavadocContentAccessUtility.createAST(CoreJavadocContentAccessUtility.java:350) + at org.eclipse.jdt.core.manipulation.internal.javadoc.CoreJavadocContentAccessUtility.getJavadocNode(CoreJavadocContentAccessUtility.java:318) + at org.eclipse.jdt.core.manipulation.internal.javadoc.CoreJavadocAccess.javadoc2HTML(CoreJavadocAccess.java:423) + at org.eclipse.jdt.core.manipulation.internal.javadoc.CoreJavadocAccess.getHTMLContentFromSource(CoreJavadocAccess.java:372) + at org.eclipse.jdt.core.manipulation.internal.javadoc.CoreJavadocAccess.getHTMLContent(CoreJavadocAccess.java:229) + at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:49) + at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:794) + at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:712) + at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:704) + at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:165) + at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:131) + at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:89) + at org.eclipse.jface.text.TextViewerHoverManager$1.run(TextViewerHoverManager.java:155) + Suppressed: java.lang.Throwable: Source line 20 : +----- + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + | +----- + at org.eclipse.jdt.internal.ui.util.SelectionUtil.logException(SelectionUtil.java:157) + at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:178) + ... 3 more + +!ENTRY org.eclipse.jdt.ui 4 2 2026-05-10 01:59:29.866 +!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ui". +!STACK 0 +java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.dom.CompilationUnit.getModule()" because "astRoot" is null + at org.eclipse.jdt.internal.ui.text.correction.proposals.AddModuleRequiresCorrectionProposalCore.createAddRequiresChange(AddModuleRequiresCorrectionProposalCore.java:87) + at org.eclipse.jdt.internal.ui.text.correction.proposals.AddModuleRequiresCorrectionProposalCore.createChange(AddModuleRequiresCorrectionProposalCore.java:73) + at org.eclipse.jdt.core.manipulation.ChangeCorrectionProposalCore.getChange(ChangeCorrectionProposalCore.java:153) + at org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsBaseSubProcessor.getCompositeChangeProposal(UnresolvedElementsBaseSubProcessor.java:1080) + at org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsBaseSubProcessor.getCompositeChangeProposal(UnresolvedElementsBaseSubProcessor.java:1072) + at org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsBaseSubProcessor.addSimilarTypeProposals(UnresolvedElementsBaseSubProcessor.java:1037) + at org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsBaseSubProcessor.collectTypeProposals(UnresolvedElementsBaseSubProcessor.java:791) + at org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor.getTypeProposals(UnresolvedElementsSubProcessor.java:143) + at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.process(QuickFixProcessor.java:450) + at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.getCorrections(QuickFixProcessor.java:370) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionCollector.safeRun(JavaCorrectionProcessor.java:381) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.run(JavaCorrectionProcessor.java:341) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.process(JavaCorrectionProcessor.java:336) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectCorrections(JavaCorrectionProcessor.java:465) + at org.eclipse.jdt.internal.ui.text.java.hover.ProblemHover$ProblemInfo.getJavaAnnotationFixes(ProblemHover.java:115) + at org.eclipse.jdt.internal.ui.text.java.hover.ProblemHover$ProblemInfo.computeCompletionProposals(ProblemHover.java:89) + at org.eclipse.jdt.internal.ui.text.java.hover.ProblemHover$ProblemInfo.(ProblemHover.java:74) + at org.eclipse.jdt.internal.ui.text.java.hover.ProblemHover.createAnnotationInfo(ProblemHover.java:178) + at org.eclipse.jdt.internal.ui.text.java.hover.AbstractAnnotationHover.getHoverInfo2(AbstractAnnotationHover.java:957) + at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:165) + at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:131) + at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:89) + at org.eclipse.jface.text.TextViewerHoverManager$1.run(TextViewerHoverManager.java:155) diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/0/00f4b1190b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/0/00f4b1190b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..83bec03 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/0/00f4b1190b4c00111d9cbe34e2b6027a @@ -0,0 +1,74 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println(); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/0/20930145034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/0/20930145034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..692ba1b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/0/20930145034c00111d9cbe34e2b6027a @@ -0,0 +1,38 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + HashSet + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1/20fb6a8f004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/1/20fb6a8f004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..0ef10d6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1/20fb6a8f004c00111d9cbe34e2b6027a @@ -0,0 +1,24 @@ +package jcf_set.exercise; + +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + + }); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/10/30987e3f034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/10/30987e3f034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..090189a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/10/30987e3f034c00111d9cbe34e2b6027a @@ -0,0 +1,38 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + HashSet aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/12/80417c38094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/12/80417c38094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..0e1693b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/12/80417c38094c00111d9cbe34e2b6027a @@ -0,0 +1,26 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/12/9025886b084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/12/9025886b084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..532044f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/12/9025886b084c00111d9cbe34e2b6027a @@ -0,0 +1,12 @@ +package jcf_set.exercise; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/12/d002b9a60b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/12/d002b9a60b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..9ea589f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/12/d002b9a60b4c00111d9cbe34e2b6027a @@ -0,0 +1,86 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println("Stampa della intersezione: "); + System.out.println(intersection(aHashSet, bHashSet)); + + // Difference + System.out.println("Stampa della differenza: "); + System.out.println(difference(aHashSet, bHashSet)); + + // Abs + System.out.println(); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/13/30573855014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/13/30573855014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..e2b7574 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/13/30573855014c00111d9cbe34e2b6027a @@ -0,0 +1,38 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/13/604a48b4054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/13/604a48b4054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..50917c4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/13/604a48b4054c00111d9cbe34e2b6027a @@ -0,0 +1,5 @@ +package jcf_set.exercise; + +public class Insiemistica { + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/13/f0eec60d034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/13/f0eec60d034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..a918377 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/13/f0eec60d034c00111d9cbe34e2b6027a @@ -0,0 +1,35 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/14/b025a533034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/14/b025a533034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..3f39b30 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/14/b025a533034c00111d9cbe34e2b6027a @@ -0,0 +1,38 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(List ) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/18/50c19cd6094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/18/50c19cd6094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..c2a97c5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/18/50c19cd6094c00111d9cbe34e2b6027a @@ -0,0 +1,45 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set union(Set s1, Set s2) { + Set intersection = new HashSet(); + + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1a/20c2cd100a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/1a/20c2cd100a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..a1bf72f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1a/20c2cd100a4c00111d9cbe34e2b6027a @@ -0,0 +1,53 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set union(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1a/50ff51ef024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/1a/50ff51ef024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..06394c9 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1a/50ff51ef024c00111d9cbe34e2b6027a @@ -0,0 +1,28 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1b/305b39a9024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/1b/305b39a9024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..4d866d9 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1b/305b39a9024c00111d9cbe34e2b6027a @@ -0,0 +1,13 @@ +package jcf_set.exercise; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1b/4092c8df044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/1b/4092c8df044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..05b1cab --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1b/4092c8df044c00111d9cbe34e2b6027a @@ -0,0 +1,74 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println(); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1e/f0a59f2b004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/1e/f0a59f2b004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..1f1fc0e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1e/f0a59f2b004c00111d9cbe34e2b6027a @@ -0,0 +1,20 @@ +package jcf_set.exercise; + +import java.util.List; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1f/20c610e3094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/1f/20c610e3094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..bc86f4c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1f/20c610e3094c00111d9cbe34e2b6027a @@ -0,0 +1,46 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set union(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/2/400a4c47014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/2/400a4c47014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..1ba9b9d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/2/400a4c47014c00111d9cbe34e2b6027a @@ -0,0 +1,36 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/2/90270fa5044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/2/90270fa5044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..fad6a3f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/2/90270fa5044c00111d9cbe34e2b6027a @@ -0,0 +1,69 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/2/e04b9f16024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/2/e04b9f16024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..57aca70 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/2/e04b9f16024c00111d9cbe34e2b6027a @@ -0,0 +1,44 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + int l1 = s1.length(); + int l2 = s2.length(); + + int cmp = Integer.compare(l2, l1); + + if (cmp != 0) return cmp; + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/20/20244af9014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/20/20244af9014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..097cf84 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/20/20244af9014c00111d9cbe34e2b6027a @@ -0,0 +1,40 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + int l1 = s1.length(); + int l2 = s2.length(); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/20/e0f1a71d014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/20/e0f1a71d014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..0f61099 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/20/e0f1a71d014c00111d9cbe34e2b6027a @@ -0,0 +1,33 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/22/00720495054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/22/00720495054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..9703226 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/22/00720495054c00111d9cbe34e2b6027a @@ -0,0 +1,84 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(testList); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 3 + /* + * Usare la classe TreeSet per eliminare i duplicati + * da un iteratore su una struttura di elementi che implementano + * Comparable, restituendo in output un iteratore che scorre + * i dati secondo l'ordine indotto dal metodo compareTo(); + */ + public static + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/22/108825d7034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/22/108825d7034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..22dff0f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/22/108825d7034c00111d9cbe34e2b6027a @@ -0,0 +1,50 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/22/80005ff7024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/22/80005ff7024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..f57494d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/22/80005ff7024c00111d9cbe34e2b6027a @@ -0,0 +1,30 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/22/a09bfe990a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/22/a09bfe990a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..c69ef67 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/22/a09bfe990a4c00111d9cbe34e2b6027a @@ -0,0 +1,64 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = HashSet(); + Iterator it = s.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/22/d0a99caa044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/22/d0a99caa044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..a20e5ae --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/22/d0a99caa044c00111d9cbe34e2b6027a @@ -0,0 +1,69 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/22/e0196522034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/22/e0196522034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..aebde83 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/22/e0196522034c00111d9cbe34e2b6027a @@ -0,0 +1,37 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates() { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/26/00311649034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/26/00311649034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..a1d42fc --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/26/00311649034c00111d9cbe34e2b6027a @@ -0,0 +1,38 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/29/90b93922024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/29/90b93922024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..20315c4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/29/90b93922024c00111d9cbe34e2b6027a @@ -0,0 +1,46 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + int l1 = s1.length(); + int l2 = s2.length(); + + int cmp = Integer.compare(l2, l1); + + if (cmp != 0) return cmp; + + return s1.compareTo(); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/2b/f0f3c19d044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/2b/f0f3c19d044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..95dfe4a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/2b/f0f3c19d044c00111d9cbe34e2b6027a @@ -0,0 +1,67 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/2f/10b8ec0b004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/2f/10b8ec0b004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..af9ed2d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/2f/10b8ec0b004c00111d9cbe34e2b6027a @@ -0,0 +1,16 @@ +package jcf_set.exercise; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/3/60b954cb094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/3/60b954cb094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..091e093 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/3/60b954cb094c00111d9cbe34e2b6027a @@ -0,0 +1,44 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set union(Set s1, Set s2) { + Set intersection = new HashSet lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/33/a04e4948044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/33/a04e4948044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..3842d9c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/33/a04e4948044c00111d9cbe34e2b6027a @@ -0,0 +1,60 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/34/a0eac3b8094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/34/a0eac3b8094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..38c4b50 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/34/a0eac3b8094c00111d9cbe34e2b6027a @@ -0,0 +1,42 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/35/90ba5661044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/35/90ba5661044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..2934127 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/35/90ba5661044c00111d9cbe34e2b6027a @@ -0,0 +1,62 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/38/c0b61dad014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/38/c0b61dad014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..e8d797a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/38/c0b61dad014c00111d9cbe34e2b6027a @@ -0,0 +1,39 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.length().compareTo(s1.length()); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/3d/70fcef05044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/3d/70fcef05044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..d3f0b36 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/3d/70fcef05044c00111d9cbe34e2b6027a @@ -0,0 +1,57 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println(); + System.out.println(lista); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/3f/f064f1ec004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/3f/f064f1ec004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..e18a3a4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/3f/f064f1ec004c00111d9cbe34e2b6027a @@ -0,0 +1,30 @@ +package jcf_set.exercise; + +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return listaOrd; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/41/e0e53463034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/41/e0e53463034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..34f7790 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/41/e0e53463034c00111d9cbe34e2b6027a @@ -0,0 +1,40 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while () + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/44/707801300b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/44/707801300b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..d0b322b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/44/707801300b4c00111d9cbe34e2b6027a @@ -0,0 +1,75 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union()); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/44/800ff988044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/44/800ff988044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..eb8ed46 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/44/800ff988044c00111d9cbe34e2b6027a @@ -0,0 +1,63 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/46/10aa9897084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/46/10aa9897084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..35c6d63 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/46/10aa9897084c00111d9cbe34e2b6027a @@ -0,0 +1,16 @@ +package jcf_set.exercise; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/46/60e18a5a034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/46/60e18a5a034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..39898b7 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/46/60e18a5a034c00111d9cbe34e2b6027a @@ -0,0 +1,40 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/46/a0603cb5004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/46/a0603cb5004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..0dfbe87 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/46/a0603cb5004c00111d9cbe34e2b6027a @@ -0,0 +1,28 @@ +package jcf_set.exercise; + +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/47/10f3489c054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/47/10f3489c054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..98ba8a9 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/47/10f3489c054c00111d9cbe34e2b6027a @@ -0,0 +1,84 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(testList); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 3 + /* + * Usare la classe TreeSet per eliminare i duplicati + * da un iteratore su una struttura di elementi che implementano + * Comparable, restituendo in output un iteratore che scorre + * i dati secondo l'ordine indotto dal metodo compareTo(); + */ + public static > Iterator + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/47/d02ada77054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/47/d02ada77054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..fddef82 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/47/d02ada77054c00111d9cbe34e2b6027a @@ -0,0 +1,80 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(testList); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 3 + /* + * + */ + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/48/7008cf9c044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/48/7008cf9c044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..29d799c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/48/7008cf9c044c00111d9cbe34e2b6027a @@ -0,0 +1,66 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/48/e0be034d034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/48/e0be034d034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..509cf71 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/48/e0be034d034c00111d9cbe34e2b6027a @@ -0,0 +1,38 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/49/901293b2004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/49/901293b2004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..70a1303 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/49/901293b2004c00111d9cbe34e2b6027a @@ -0,0 +1,27 @@ +package jcf_set.exercise; + +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4b/609bd4a8014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/4b/609bd4a8014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..7cdbd63 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4b/609bd4a8014c00111d9cbe34e2b6027a @@ -0,0 +1,39 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.length().compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4c/507e9d26014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/4c/507e9d26014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..5b8e90e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4c/507e9d26014c00111d9cbe34e2b6027a @@ -0,0 +1,34 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4d/301d8c89034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/4d/301d8c89034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..94e904b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4d/301d8c89034c00111d9cbe34e2b6027a @@ -0,0 +1,47 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4d/80a1c732044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/4d/80a1c732044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..15562b4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4d/80a1c732044c00111d9cbe34e2b6027a @@ -0,0 +1,61 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Stampa collections + + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4d/c0774f6c094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/4d/c0774f6c094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..64d5bfe --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4d/c0774f6c094c00111d9cbe34e2b6027a @@ -0,0 +1,34 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union () { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4f/a0159a1a014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/4f/a0159a1a014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..8509993 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4f/a0159a1a014c00111d9cbe34e2b6027a @@ -0,0 +1,33 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4f/d0e5fa51094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/4f/d0e5fa51094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..395e92e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4f/d0e5fa51094c00111d9cbe34e2b6027a @@ -0,0 +1,32 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5/00b5ffda034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/5/00b5ffda034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..e9799fc --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5/00b5ffda034c00111d9cbe34e2b6027a @@ -0,0 +1,51 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/50/00a14454044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/50/00a14454044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..2934127 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/50/00a14454044c00111d9cbe34e2b6027a @@ -0,0 +1,62 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/53/30542671094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/53/30542671094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..c5933e2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/53/30542671094c00111d9cbe34e2b6027a @@ -0,0 +1,34 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/55/b0110afb034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/55/b0110afb034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..a366369 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/55/b0110afb034c00111d9cbe34e2b6027a @@ -0,0 +1,54 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println(); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/56/70654bb1024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/56/70654bb1024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..6b838b1 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/56/70654bb1024c00111d9cbe34e2b6027a @@ -0,0 +1,17 @@ +package jcf_set.exercise; + +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/58/902e92d0034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/58/902e92d0034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..06c79f1 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/58/902e92d0034c00111d9cbe34e2b6027a @@ -0,0 +1,50 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/59/b0b9e62b034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/59/b0b9e62b034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..f36ea4f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/59/b0b9e62b034c00111d9cbe34e2b6027a @@ -0,0 +1,38 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates() { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5a/50985554014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/5a/50985554014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..0ced78e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5a/50985554014c00111d9cbe34e2b6027a @@ -0,0 +1,38 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(); + } + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5b/c09d6452014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/5b/c09d6452014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..0ba6031 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5b/c09d6452014c00111d9cbe34e2b6027a @@ -0,0 +1,38 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + + } + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5c/c0d7db460b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/5c/c0d7db460b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..61118bf --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5c/c0d7db460b4c00111d9cbe34e2b6027a @@ -0,0 +1,78 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println(); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5d/000b145d084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/5d/000b145d084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..3175e50 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5d/000b145d084c00111d9cbe34e2b6027a @@ -0,0 +1,12 @@ +package jcf_set.exercise; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5e/50daf402034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/5e/50daf402034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..a65c2a1 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5e/50daf402034c00111d9cbe34e2b6027a @@ -0,0 +1,34 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/61/e0746fbb044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/61/e0746fbb044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..32b8d59 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/61/e0746fbb044c00111d9cbe34e2b6027a @@ -0,0 +1,71 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDup = getIteratorNoDuplicatesOrdinated(); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/62/30f171ce044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/62/30f171ce044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..4a7f8f6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/62/30f171ce044c00111d9cbe34e2b6027a @@ -0,0 +1,72 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDup = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDup.hasNext()) testList.add(); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/63/70a87bc70a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/63/70a87bc70a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..543a583 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/63/70a87bc70a4c00111d9cbe34e2b6027a @@ -0,0 +1,67 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Unione + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/6a/e0766606024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/6a/e0766606024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..153f536 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/6a/e0766606024c00111d9cbe34e2b6027a @@ -0,0 +1,42 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + int l1 = s1.length(); + int l2 = s2.length(); + + int cmp = + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/6c/6037ed4c084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/6c/6037ed4c084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..d7ed3a7 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/6c/6037ed4c084c00111d9cbe34e2b6027a @@ -0,0 +1,9 @@ +package jcf_set.exercise; + +public class Insiemistica { + + public static void main(String[] main) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/6f/90c3b5e4094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/6f/90c3b5e4094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..f1fbf8f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/6f/90c3b5e4094c00111d9cbe34e2b6027a @@ -0,0 +1,47 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set union(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/74/c0394280044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/74/c0394280044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..9116428 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/74/c0394280044c00111d9cbe34e2b6027a @@ -0,0 +1,63 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/75/d031a65e0a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/75/d031a65e0a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..59d3b4d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/75/d031a65e0a4c00111d9cbe34e2b6027a @@ -0,0 +1,58 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/76/d0c25c7e024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/76/d0c25c7e024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..aea4298 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/76/d0c25c7e024c00111d9cbe34e2b6027a @@ -0,0 +1,7 @@ +package jcf_set.exercise; + +public class IteratoreSenzaDuplicati { + + + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/76/f006391e044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/76/f006391e044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..4fb27b0 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/76/f006391e044c00111d9cbe34e2b6027a @@ -0,0 +1,57 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/76/f0276bc9004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/76/f0276bc9004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..3a52c14 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/76/f0276bc9004c00111d9cbe34e2b6027a @@ -0,0 +1,30 @@ +package jcf_set.exercise; + +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if () + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/77/b061c17a044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/77/b061c17a044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..4a5f6b6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/77/b061c17a044c00111d9cbe34e2b6027a @@ -0,0 +1,63 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/78/9040e73e0b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/78/9040e73e0b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..ffc4530 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/78/9040e73e0b4c00111d9cbe34e2b6027a @@ -0,0 +1,78 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/79/604fa8e3024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/79/604fa8e3024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..8b78843 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/79/604fa8e3024c00111d9cbe34e2b6027a @@ -0,0 +1,25 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/79/d04bc058094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/79/d04bc058094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..f2aac67 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/79/d04bc058094c00111d9cbe34e2b6027a @@ -0,0 +1,32 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/7a/c05267280a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/7a/c05267280a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..e317568 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/7a/c05267280a4c00111d9cbe34e2b6027a @@ -0,0 +1,55 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/7a/e060276c0a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/7a/e060276c0a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..61377b4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/7a/e060276c0a4c00111d9cbe34e2b6027a @@ -0,0 +1,63 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s1) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/7e/a0b3bb83054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/7e/a0b3bb83054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..6287e9a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/7e/a0b3bb83054c00111d9cbe34e2b6027a @@ -0,0 +1,84 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(testList); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 3 + /* + * Usare la classe TreeSet per eliminare i duplicati + * da un iteratore su una struttura di elementi che implementano + * Comparable, restituendo in output un iteratore che scorre + * i dati secondo l'ordine indotto dal metodo compareTo(); + */ + + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/7f/c069c989024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/7f/c069c989024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..9b892cb --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/7f/c069c989024c00111d9cbe34e2b6027a @@ -0,0 +1,13 @@ +package jcf_set.exercise; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + + } + + public void run() { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/7f/e0a72595004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/7f/e0a72595004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..b4f38d0 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/7f/e0a72595004c00111d9cbe34e2b6027a @@ -0,0 +1,25 @@ +package jcf_set.exercise; + +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + + }); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/8/30bd536b0a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/8/30bd536b0a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..060d9f3 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/8/30bd536b0a4c00111d9cbe34e2b6027a @@ -0,0 +1,63 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs() { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/8/d0aa767a094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/8/d0aa767a094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..d5a2f8b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/8/d0aa767a094c00111d9cbe34e2b6027a @@ -0,0 +1,34 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/81/d0c19a560b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/81/d0c19a560b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..f4d59ae --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/81/d0c19a560b4c00111d9cbe34e2b6027a @@ -0,0 +1,79 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println("Stampa della intersezione: "); + System.out.println(); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/83/0084cfd8024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/83/0084cfd8024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..75f2aff --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/83/0084cfd8024c00111d9cbe34e2b6027a @@ -0,0 +1,24 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/84/60046815024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/84/60046815024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..951fd71 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/84/60046815024c00111d9cbe34e2b6027a @@ -0,0 +1,42 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + int l1 = s1.length(); + int l2 = s2.length(); + + int cmp = Integer.compare(l2, l1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/84/60615f8f0b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/84/60615f8f0b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..b14f6c8 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/84/60615f8f0b4c00111d9cbe34e2b6027a @@ -0,0 +1,83 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println("Stampa della intersezione: "); + System.out.println(intersection(aHashSet, bHashSet)); + + // Difference + System.out.println("Stampa della differenza: "); + System.out.println(); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/84/801541cd084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/84/801541cd084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..8b8ae51 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/84/801541cd084c00111d9cbe34e2b6027a @@ -0,0 +1,20 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/87/106c56f20a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/87/106c56f20a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..20ecff3 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/87/106c56f20a4c00111d9cbe34e2b6027a @@ -0,0 +1,72 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(); + + // Unione + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/89/0097718a0a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/89/0097718a0a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..fa05f14 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/89/0097718a0a4c00111d9cbe34e2b6027a @@ -0,0 +1,63 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = HashSet(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/8c/400d06a40a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/8c/400d06a40a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..672b5ab --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/8c/400d06a40a4c00111d9cbe34e2b6027a @@ -0,0 +1,66 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/8c/e0d57182024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/8c/e0d57182024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..4b7c71b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/8c/e0d57182024c00111d9cbe34e2b6027a @@ -0,0 +1,9 @@ +package jcf_set.exercise; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/8d/00701343094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/8d/00701343094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..5938b3d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/8d/00701343094c00111d9cbe34e2b6027a @@ -0,0 +1,31 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/8d/10233d02034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/8d/10233d02034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..c92cada --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/8d/10233d02034c00111d9cbe34e2b6027a @@ -0,0 +1,33 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + */ + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/8f/8022932a014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/8f/8022932a014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..86f4a72 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/8f/8022932a014c00111d9cbe34e2b6027a @@ -0,0 +1,34 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/90/e0b44c49044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/90/e0b44c49044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..23f9e6a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/90/e0b44c49044c00111d9cbe34e2b6027a @@ -0,0 +1,61 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/94/002be386084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/94/002be386084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..b80924a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/94/002be386084c00111d9cbe34e2b6027a @@ -0,0 +1,15 @@ +package jcf_set.exercise; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/94/308125c8034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/94/308125c8034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..b028808 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/94/308125c8034c00111d9cbe34e2b6027a @@ -0,0 +1,50 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(){ + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/95/a0fefbe0034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/95/a0fefbe0034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..4bf3cd4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/95/a0fefbe0034c00111d9cbe34e2b6027a @@ -0,0 +1,52 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while () + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/95/d0608886084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/95/d0608886084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..c54cfe7 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/95/d0608886084c00111d9cbe34e2b6027a @@ -0,0 +1,15 @@ +package jcf_set.exercise; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/96/00d0ca8a094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/96/00d0ca8a094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..29725aa --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/96/00d0ca8a094c00111d9cbe34e2b6027a @@ -0,0 +1,37 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/96/e0330a380b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/96/e0330a380b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..76b7096 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/96/e0330a380b4c00111d9cbe34e2b6027a @@ -0,0 +1,77 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/97/602e8ce7044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/97/602e8ce7044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..b3170fa --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/97/602e8ce7044c00111d9cbe34e2b6027a @@ -0,0 +1,75 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/97/908335aa044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/97/908335aa044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..efec8e4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/97/908335aa044c00111d9cbe34e2b6027a @@ -0,0 +1,69 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/9b/90aad0d8044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/9b/90aad0d8044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..8bba5ab --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/9b/90aad0d8044c00111d9cbe34e2b6027a @@ -0,0 +1,72 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/9c/305f9b2b0b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/9c/305f9b2b0b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..0421d52 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/9c/305f9b2b0b4c00111d9cbe34e2b6027a @@ -0,0 +1,74 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a/106cd140054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a/106cd140054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..f084506 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a/106cd140054c00111d9cbe34e2b6027a @@ -0,0 +1,75 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(testList); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a/90fefde3044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a/90fefde3044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..8b9539c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a/90fefde3044c00111d9cbe34e2b6027a @@ -0,0 +1,74 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a/c01642c2034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a/c01642c2034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..dbf6dac --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a/c01642c2034c00111d9cbe34e2b6027a @@ -0,0 +1,48 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a/c07c0cb30a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a/c07c0cb30a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..90f699a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a/c07c0cb30a4c00111d9cbe34e2b6027a @@ -0,0 +1,66 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a0/40f32b11004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a0/40f32b11004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..ab0e9c0 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a0/40f32b11004c00111d9cbe34e2b6027a @@ -0,0 +1,20 @@ +package jcf_set.exercise; + +import java.util.List; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista ) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a1/901cf2db094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a1/901cf2db094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..7c53c6a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a1/901cf2db094c00111d9cbe34e2b6027a @@ -0,0 +1,46 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set union(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a2/a061a602024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a2/a061a602024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..153f536 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a2/a061a602024c00111d9cbe34e2b6027a @@ -0,0 +1,42 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + int l1 = s1.length(); + int l2 = s2.length(); + + int cmp = + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e04792050b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e04792050b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..bfefefc --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e04792050b4c00111d9cbe34e2b6027a @@ -0,0 +1,72 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + + // Unione + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a4/809bed8e054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a4/809bed8e054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..281e34f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a4/809bed8e054c00111d9cbe34e2b6027a @@ -0,0 +1,84 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(testList); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 3 + /* + * Usare la classe TreeSet per eliminare i duplicati + * da un iteratore su una struttura di elementi che implementano + * Comparable, restituendo in output un iteratore che scorre + * i dati secondo l'ordine indotto dal metodo compareTo(); + */ + public static + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a4/d0c5ff94ff4b00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a4/d0c5ff94ff4b00111d9cbe34e2b6027a new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a9/3038f2b7084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/a9/3038f2b7084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..53b347a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a9/3038f2b7084c00111d9cbe34e2b6027a @@ -0,0 +1,19 @@ +package jcf_set.exercise; + +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/aa/d05bc382034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/aa/d05bc382034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..08f384f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/aa/d05bc382034c00111d9cbe34e2b6027a @@ -0,0 +1,41 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ac/000428b7004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ac/000428b7004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..f3cd7b1 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ac/000428b7004c00111d9cbe34e2b6027a @@ -0,0 +1,29 @@ +package jcf_set.exercise; + +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ac/30bc05e4034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ac/30bc05e4034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..acccba6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ac/30bc05e4034c00111d9cbe34e2b6027a @@ -0,0 +1,52 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ac/d034aa6e024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ac/d034aa6e024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ae/101252870b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ae/101252870b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..4be0300 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ae/101252870b4c00111d9cbe34e2b6027a @@ -0,0 +1,82 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println("Stampa della intersezione: "); + System.out.println(intersection(aHashSet, bHashSet)); + + // Difference + System.out.println(); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ae/9006794b0b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ae/9006794b0b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..15d8526 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ae/9006794b0b4c00111d9cbe34e2b6027a @@ -0,0 +1,78 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println("Stampa della intersezione: "); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/af/2085dd10004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/af/2085dd10004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..f614ac5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/af/2085dd10004c00111d9cbe34e2b6027a @@ -0,0 +1,20 @@ +package jcf_set.exercise; + +import java.util.List; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0db97b4034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0db97b4034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..c163f27 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0db97b4034c00111d9cbe34e2b6027a @@ -0,0 +1,48 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static Iterator + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b1/90e17a76084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b1/90e17a76084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..0328a7e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b1/90e17a76084c00111d9cbe34e2b6027a @@ -0,0 +1,15 @@ +package jcf_set.exercise; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b2/60b84742054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b2/60b84742054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..c494a45 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b2/60b84742054c00111d9cbe34e2b6027a @@ -0,0 +1,78 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(testList); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 3 + + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b2/f04311e7024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b2/f04311e7024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..fce3af6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b2/f04311e7024c00111d9cbe34e2b6027a @@ -0,0 +1,26 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b3/40a0f8b2024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b3/40a0f8b2024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..30ddb74 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b3/40a0f8b2024c00111d9cbe34e2b6027a @@ -0,0 +1,17 @@ +package jcf_set.exercise; + +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b3/a023c083094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b3/a023c083094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..1ad4b34 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b3/a023c083094c00111d9cbe34e2b6027a @@ -0,0 +1,34 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b3/c0fd5179054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b3/c0fd5179054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..2eccd72 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b3/c0fd5179054c00111d9cbe34e2b6027a @@ -0,0 +1,83 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(testList); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 3 + /* + * Usare la classe TreeSet per eliminare i duplicati + * da un iteratore su una struttura di elementi che implementano + * Comparable, restituendo in output un iteratore che scorre + * i dati secondo l'ordine indotto dal metodo compareTo(); + */ + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b4/102089f1014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b4/102089f1014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..ef166e6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b4/102089f1014c00111d9cbe34e2b6027a @@ -0,0 +1,39 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b6/000a3c330b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b6/000a3c330b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..39c27a5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b6/000a3c330b4c00111d9cbe34e2b6027a @@ -0,0 +1,75 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b7/c054709a004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b7/c054709a004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..b96cfb3 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b7/c054709a004c00111d9cbe34e2b6027a @@ -0,0 +1,27 @@ +package jcf_set.exercise; + +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare() { + + } + }); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b8/f082ea0a034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b8/f082ea0a034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..dfed9d6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b8/f082ea0a034c00111d9cbe34e2b6027a @@ -0,0 +1,35 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b9/80185da3094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/b9/80185da3094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..36b77fd --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b9/80185da3094c00111d9cbe34e2b6027a @@ -0,0 +1,41 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * + */ + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b09f0bbf0a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b09f0bbf0a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..456e257 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b09f0bbf0a4c00111d9cbe34e2b6027a @@ -0,0 +1,67 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/bc/10e8bdc1024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/bc/10e8bdc1024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..bdc60d7 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/bc/10e8bdc1024c00111d9cbe34e2b6027a @@ -0,0 +1,21 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c01fd1f6ff4b00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c01fd1f6ff4b00111d9cbe34e2b6027a new file mode 100644 index 0000000..3e28978 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c01fd1f6ff4b00111d9cbe34e2b6027a @@ -0,0 +1,5 @@ +package jcf_set.exercise; + +public class EsercizioParole { + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/bd/3002256aff4b00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/bd/3002256aff4b00111d9cbe34e2b6027a new file mode 100644 index 0000000..628b392 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/bd/3002256aff4b00111d9cbe34e2b6027a @@ -0,0 +1,170 @@ +package parziale.p251110; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; +import java.util.TreeMap; + +public class Clinica { + + ArrayList pazienti = new ArrayList(); + + // 1. Numero di pazienti Ricoverati + public int pazientiRicoverati() { + return pazienti.size(); + } + + // 2. Inserimento del paziente + /* + * Dal momento che non ci è permesso adoperare + * TreeSet per l'ordine e per l'unicità + */ + public boolean ricoveraPaziente(Paziente paziente) { + // Se il paziente è nullo, nulla verrà aggiunto + if (paziente == null) return false; + + // Controllo se il paziente è già presente nella lista ricoveri + Iterator it = pazienti.iterator(); + while (it.hasNext()) { + Paziente current = it.next(); + if (paziente.equals(current)) return false; // Se è già presente un paziente con id uguale allora non viene aggiunto e ritorna false + } + + // Aggiunta del paziente + ListIterator lit = pazienti.listIterator(); + while (lit.hasNext()) { + Paziente current = lit.next(); + int cmp = current.compareTo(paziente); + if (cmp > 0) { + lit.previous(); + lit.add(paziente); + return true; + } + } + + lit.add(paziente); + return true; + } + + // 3. Dimissione + public Paziente dimettiPaziente(String id, int annoNascita) { + if (id == null || annoNascita <= 0) return null; + Paziente tmp = new Paziente(id, annoNascita); + + Iterator iterator = pazienti.iterator(); + while (iterator.hasNext()) { + Paziente current = iterator.next(); + int cmp = current.compareTo(tmp); + if (cmp == 0) { + // Paziente da rimuovere + iterator.remove(); + return current; + } + if (cmp > 0) return null; + } + + return null; + } + + // 4. Età media + public int etaMedia() { + if (pazienti.isEmpty()) return 0; + + int currentDate = LocalDate.now().getYear(); + int avg = 0; + + Iterator it = pazienti.iterator(); + while (it.hasNext()) { + int ageYear = currentDate - it.next().getAnnoNascita(); + avg += ageYear; + } + + return avg / pazienti.size(); + } + + // 5. Età più rappresenta + public int etaMediaPiuRappresentata() { + if (pazienti.isEmpty()) return 0; + + int currentDate = LocalDate.now().getYear(); + TreeMap listaEta = new TreeMap(); + + Iterator it = pazienti.iterator(); + while (it.hasNext()) { + Paziente current = it.next(); + int currentAge = currentDate - current.getAnnoNascita(); + + if (listaEta.get(currentAge) == null) listaEta.put(currentAge, 1); + else listaEta.put(currentAge, listaEta.get(currentAge) + 1); + } + + int maxAge = 0; + int maxFrequency = 0; + + for (Integer i : listaEta.keySet()) { + int currentFrequency = listaEta.get(i); + + if (currentFrequency > maxFrequency) { + maxFrequency = currentFrequency; + maxAge = i; + } + + } + + return maxAge; + } + + // 6. Ricoverati ordinati per codice + public ArrayList ricoveratiOrdinatiPerCodice() { + ArrayList ricoverati = new ArrayList(pazienti); + + ricoverati.sort(new Comparator() { + @Override + public int compare(Paziente p1, Paziente p2) { + String id1 = p1.getId(); + String id2 = p2.getId(); + return id1.compareTo(id2); + } + }); + + return ricoverati; + } + + // 7. Distribuzione pazienti per anno di nascita + public Map pazientiPerAnnoDiNascita() { + // AnnoNascita, NumeroPazienti + Map pazientiPerAnnoDiNascita = new TreeMap(); // Si usa TreeMap per avere una vista già ordinata di anni + + if (pazienti.isEmpty()) return pazientiPerAnnoDiNascita; + + Iterator it = pazienti.iterator(); + while (it.hasNext()) { + Paziente current = it.next(); + int annoNascita = current.getAnnoNascita(); + + if (pazientiPerAnnoDiNascita.get(annoNascita) == null) pazientiPerAnnoDiNascita.put(annoNascita, 1); + else pazientiPerAnnoDiNascita.put(annoNascita, pazientiPerAnnoDiNascita.get(annoNascita) + 1); + } + + return pazientiPerAnnoDiNascita; + } + + public static List ordinaListaClinicaPerNumeroPazienti(List cliniche) { + if (cliniche == null) throw new NullPointerException(); + + cliniche.sort(new Comparator() { + @Override + public int compare(Clinica c1, Clinica c2) { + int pazienti1 = c1.pazienti.size(); + int pazienti2 = c2.pazienti.size(); + return pazienti1 - pazienti2; + } + }); + + return cliniche; + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/bd/30225d7f0a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/bd/30225d7f0a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..13b4db5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/bd/30225d7f0a4c00111d9cbe34e2b6027a @@ -0,0 +1,63 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/bd/80045ef8034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/bd/80045ef8034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..11c4909 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/bd/80045ef8034c00111d9cbe34e2b6027a @@ -0,0 +1,53 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c/70fb2721024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c/70fb2721024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..6cc7e51 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c/70fb2721024c00111d9cbe34e2b6027a @@ -0,0 +1,46 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + int l1 = s1.length(); + int l2 = s2.length(); + + int cmp = Integer.compare(l2, l1); + + if (cmp != 0) return cmp; + + + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c/b0ff8da7034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c/b0ff8da7034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..b1e0043 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c/b0ff8da7034c00111d9cbe34e2b6027a @@ -0,0 +1,48 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10c476b9024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10c476b9024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..9dc50dd --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10c476b9024c00111d9cbe34e2b6027a @@ -0,0 +1,19 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c1/30b533390a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c1/30b533390a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..a8fe33d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c1/30b533390a4c00111d9cbe34e2b6027a @@ -0,0 +1,55 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d000a29c0b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d000a29c0b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..bc222d4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d000a29c0b4c00111d9cbe34e2b6027a @@ -0,0 +1,85 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println("Stampa della intersezione: "); + System.out.println(intersection(aHashSet, bHashSet)); + + // Difference + System.out.println("Stampa della differenza: "); + System.out.println(difference(aHashSet, bHashSet)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c2/40e8a9c6044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c2/40e8a9c6044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..91bcae6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c2/40e8a9c6044c00111d9cbe34e2b6027a @@ -0,0 +1,71 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDup = getIteratorNoDuplicatesOrdinated(lista.iterator()); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c2/d03b6217044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c2/d03b6217044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..a4fa66f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c2/d03b6217044c00111d9cbe34e2b6027a @@ -0,0 +1,57 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println(""); + System.out.println(lista); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c4/80827cab044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c4/80827cab044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..e9ee94d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c4/80827cab044c00111d9cbe34e2b6027a @@ -0,0 +1,70 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c5/204ee6b7044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c5/204ee6b7044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..ec0fad4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c5/204ee6b7044c00111d9cbe34e2b6027a @@ -0,0 +1,71 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c6/102c9022044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c6/102c9022044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..c77635d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c6/102c9022044c00111d9cbe34e2b6027a @@ -0,0 +1,58 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c6/308913a3054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c6/308913a3054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..b301eed --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c6/308913a3054c00111d9cbe34e2b6027a @@ -0,0 +1,86 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(testList); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 3 + /* + * Usare la classe TreeSet per eliminare i duplicati + * da un iteratore su una struttura di elementi che implementano + * Comparable, restituendo in output un iteratore che scorre + * i dati secondo l'ordine indotto dal metodo compareTo(); + */ + public static > Iterator iteratorNoDupOrd() { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c6/e0189a6a044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c6/e0189a6a044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..3422a5d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c6/e0189a6a044c00111d9cbe34e2b6027a @@ -0,0 +1,62 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c7/d0c04a0b024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/c7/d0c04a0b024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..510decf --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c7/d0c04a0b024c00111d9cbe34e2b6027a @@ -0,0 +1,42 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + int l1 = s1.length(); + int l2 = s2.length(); + + int cmp = Integer.compare(); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ca/101b0974044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ca/101b0974044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..1c86e52 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ca/101b0974044c00111d9cbe34e2b6027a @@ -0,0 +1,62 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/cb/10fc1ba2004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/cb/10fc1ba2004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..d97d102 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/cb/10fc1ba2004c00111d9cbe34e2b6027a @@ -0,0 +1,27 @@ +package jcf_set.exercise; + +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + + } + }); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/cc/809b308d004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/cc/809b308d004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..9238759 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/cc/809b308d004c00111d9cbe34e2b6027a @@ -0,0 +1,20 @@ +package jcf_set.exercise; + +import java.util.List; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ce/d0077121014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ce/d0077121014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..b009640 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ce/d0077121014c00111d9cbe34e2b6027a @@ -0,0 +1,34 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/cf/a0297b77ff4b00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/cf/a0297b77ff4b00111d9cbe34e2b6027a new file mode 100644 index 0000000..0e07468 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/cf/a0297b77ff4b00111d9cbe34e2b6027a @@ -0,0 +1,66 @@ +package comparatori.videogioco; + +public class Videogioco implements Comparable{ + + // Campi di istanza + private String titolo; + private String piattaforma; + private Integer annoUscita; + private Double prezzo; + private Integer voto; + + // Costruttore + + private Videogioco() {} + + public Videogioco( + String titolo, + String piattaforma, + Integer annoUscita, + Double prezzo, + Integer voto) { + this.titolo = (titolo == null) ? "" : titolo.trim(); + this.piattaforma = (piattaforma == null) ? "" : piattaforma.trim(); + this.annoUscita = (annoUscita == null) ? 0 : annoUscita; + this.prezzo = (prezzo == null) ? 0.0 : prezzo; + this.voto = (voto == null) ? 0 : voto; + } + + // Getter + public String titolo() { + return titolo; + } + + public String piattaforma() { + return piattaforma; + } + + public Integer annoUscita() { + return annoUscita; + } + + public Double prezzo() { + return prezzo; + } + + public Integer voto() { + return voto; + } + + // Implementazione del metodo comparatore + + /** + * compareTo ordina per prezzo crescente + */ + @Override + public int compareTo(Videogioco videogioco) { + if (this.prezzo < videogioco.prezzo) return -1; + if (this.prezzo > videogioco.prezzo) return 1; + return 0; + } + + @Override + public String toString() { + return titolo + " " + piattaforma + " " + annoUscita + " " + prezzo + " " + voto; + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d/a0377873024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/d/a0377873024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..6639914 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d/a0377873024c00111d9cbe34e2b6027a @@ -0,0 +1,5 @@ +package jcf_set.exercise; + +public class IteratoreSenzaDuplicati { + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d2/90952b1f0a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/d2/90952b1f0a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..e2aa220 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d2/90952b1f0a4c00111d9cbe34e2b6027a @@ -0,0 +1,53 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set un +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d4/0069eab5024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/d4/0069eab5024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..39d270e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d4/0069eab5024c00111d9cbe34e2b6027a @@ -0,0 +1,17 @@ +package jcf_set.exercise; + +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f06d713e034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f06d713e034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..481d012 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f06d713e034c00111d9cbe34e2b6027a @@ -0,0 +1,38 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d5/80ce7fe5024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/d5/80ce7fe5024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..6d11632 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d5/80ce7fe5024c00111d9cbe34e2b6027a @@ -0,0 +1,26 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruits"); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d6/007618e3034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/d6/007618e3034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..de9bccf --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d6/007618e3034c00111d9cbe34e2b6027a @@ -0,0 +1,52 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d6/101c34a5014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/d6/101c34a5014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..6411782 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d6/101c34a5014c00111d9cbe34e2b6027a @@ -0,0 +1,39 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d7/b0aa1ee9034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/d7/b0aa1ee9034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..844f75e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d7/b0aa1ee9034c00111d9cbe34e2b6027a @@ -0,0 +1,53 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d8/00a835910b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/d8/00a835910b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..f25e0ae --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d8/00a835910b4c00111d9cbe34e2b6027a @@ -0,0 +1,83 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println("Stampa della intersezione: "); + System.out.println(intersection(aHashSet, bHashSet)); + + // Difference + System.out.println("Stampa della differenza: "); + System.out.println(difference(aHashSet, bHashSet)); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/da/e0411544044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/da/e0411544044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..b21035d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/da/e0411544044c00111d9cbe34e2b6027a @@ -0,0 +1,60 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/db/70a2cccc004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/db/70a2cccc004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..240467e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/db/70a2cccc004c00111d9cbe34e2b6027a @@ -0,0 +1,30 @@ +package jcf_set.exercise; + +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/db/90de48620b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/db/90de48620b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..bb5a7ac --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/db/90de48620b4c00111d9cbe34e2b6027a @@ -0,0 +1,79 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println("Stampa della intersezione: "); + System.out.println(intersection(aHashSet, bHashSet)); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/dc/309b6145084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/dc/309b6145084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..aa5dc92 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/dc/309b6145084c00111d9cbe34e2b6027a @@ -0,0 +1,5 @@ +package jcf_set.exercise; + +public class Insiemistica { + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/dc/400537d3024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/dc/400537d3024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..52b823a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/dc/400537d3024c00111d9cbe34e2b6027a @@ -0,0 +1,21 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add(); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/dd/d0b636b4084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/dd/d0b636b4084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..bd566ce --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/dd/d0b636b4084c00111d9cbe34e2b6027a @@ -0,0 +1,16 @@ +package jcf_set.exercise; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(aArray); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/de/10c43961014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/de/10c43961014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..ec21734 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/de/10c43961014c00111d9cbe34e2b6027a @@ -0,0 +1,40 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + return s2.compareTo(s1); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/de/e08d3fb6024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/de/e08d3fb6024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..4ff379c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/de/e08d3fb6024c00111d9cbe34e2b6027a @@ -0,0 +1,18 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/df/0090896c084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/df/0090896c084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..5b72030 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/df/0090896c084c00111d9cbe34e2b6027a @@ -0,0 +1,13 @@ +package jcf_set.exercise; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/df/d0665ef5084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/df/d0665ef5084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..5419ade --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/df/d0665ef5084c00111d9cbe34e2b6027a @@ -0,0 +1,23 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/e0/5026a626004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/e0/5026a626004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..d636bb1 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/e0/5026a626004c00111d9cbe34e2b6027a @@ -0,0 +1,20 @@ +package jcf_set.exercise; + +import java.util.List; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/e1/208feab2054c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/e1/208feab2054c00111d9cbe34e2b6027a new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/e1/f07e1b0e004c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/e1/f07e1b0e004c00111d9cbe34e2b6027a new file mode 100644 index 0000000..83d3857 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/e1/f07e1b0e004c00111d9cbe34e2b6027a @@ -0,0 +1,20 @@ +package jcf_set.exercise; + +import java.util.List; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList() { + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/e2/e05fb887094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/e2/e05fb887094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..268c9b2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/e2/e05fb887094c00111d9cbe34e2b6027a @@ -0,0 +1,37 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/e6/a0c5a868034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/e6/a0c5a868034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..cc9858f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/e6/a0c5a868034c00111d9cbe34e2b6027a @@ -0,0 +1,40 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/e9/b008311a034c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/e9/b008311a034c00111d9cbe34e2b6027a new file mode 100644 index 0000000..452e1af --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/e9/b008311a034c00111d9cbe34e2b6027a @@ -0,0 +1,35 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + + + } + + // Esercizio 1 + /* + * Ottenere una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static Iterator + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ea/40278197044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ea/40278197044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..70f7910 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ea/40278197044c00111d9cbe34e2b6027a @@ -0,0 +1,65 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println(); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ea/c0649d04044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ea/c0649d04044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..5bd6cb3 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ea/c0649d04044c00111d9cbe34e2b6027a @@ -0,0 +1,54 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println(lista); + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ec/001ca7fd094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ec/001ca7fd094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..14859f1 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ec/001ca7fd094c00111d9cbe34e2b6027a @@ -0,0 +1,51 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set union(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * + */ +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ef/3082a4d3044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/ef/3082a4d3044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..58a5302 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ef/3082a4d3044c00111d9cbe34e2b6027a @@ -0,0 +1,72 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f/9018d048094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/f/9018d048094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..e268fe2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f/9018d048094c00111d9cbe34e2b6027a @@ -0,0 +1,32 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f/e01a47af0b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/f/e01a47af0b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..38dafbd --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f/e01a47af0b4c00111d9cbe34e2b6027a @@ -0,0 +1,87 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println("Stampa della intersezione: "); + System.out.println(intersection(aHashSet, bHashSet)); + + // Difference + System.out.println("Stampa della differenza: "); + System.out.println(difference(aHashSet, bHashSet)); + + // Abs + System.out.println("Stampa della ABS: "); + System.out.println(); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f2/a02f0dd90a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/f2/a02f0dd90a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..a335016 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f2/a02f0dd90a4c00111d9cbe34e2b6027a @@ -0,0 +1,71 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + + + // Unione + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f5/b0abf7c7094c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/f5/b0abf7c7094c00111d9cbe34e2b6027a new file mode 100644 index 0000000..a5c0b94 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f5/b0abf7c7094c00111d9cbe34e2b6027a @@ -0,0 +1,44 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set union(Set s1, Set s2) { + + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f6/30b05af7014c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/f6/30b05af7014c00111d9cbe34e2b6027a new file mode 100644 index 0000000..d2813f9 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f6/30b05af7014c00111d9cbe34e2b6027a @@ -0,0 +1,39 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + int l1 = s1.length(); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f9/408d3424044c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/f9/408d3424044c00111d9cbe34e2b6027a new file mode 100644 index 0000000..15562b4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f9/408d3424044c00111d9cbe34e2b6027a @@ -0,0 +1,61 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Stampa collections + + + + + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e0eb29be024c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e0eb29be024c00111d9cbe34e2b6027a new file mode 100644 index 0000000..5cc426f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e0eb29be024c00111d9cbe34e2b6027a @@ -0,0 +1,20 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add(); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f9/f047f2ce084c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/f9/f047f2ce084c00111d9cbe34e2b6027a new file mode 100644 index 0000000..03d2687 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f9/f047f2ce084c00111d9cbe34e2b6027a @@ -0,0 +1,21 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/fd/700e46650a4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/fd/700e46650a4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..3976a3f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/fd/700e46650a4c00111d9cbe34e2b6027a @@ -0,0 +1,61 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/fe/a05b74130b4c00111d9cbe34e2b6027a b/.metadata/.plugins/org.eclipse.core.resources/.history/fe/a05b74130b4c00111d9cbe34e2b6027a new file mode 100644 index 0000000..45d75c0 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/fe/a05b74130b4c00111d9cbe34e2b6027a @@ -0,0 +1,74 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.markers.snap index 4eb4941..464a957 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.markers.snap and b/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.markers.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.syncinfo.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.syncinfo.snap index 4eb4941..464a957 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.syncinfo.snap and b/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.syncinfo.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.indexes/e4/a/72/history.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.indexes/e4/a/72/history.index new file mode 100644 index 0000000..27c1dd0 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.indexes/e4/a/72/history.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.indexes/e4/ad/a2/history.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.indexes/e4/ad/a2/history.index index 4ad7dbb..de5271e 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.indexes/e4/ad/a2/history.index and b/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.indexes/e4/ad/a2/history.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.markers.snap index a27931a..77a20c2 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.markers.snap and b/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.markers.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.syncinfo.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.syncinfo.snap index bd4e281..64b1875 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.syncinfo.snap and b/.metadata/.plugins/org.eclipse.core.resources/.projects/asdl/.syncinfo.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap index bf7253e..5ed9b35 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap and b/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources index c98f29b..3d6c9b7 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources and b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/1.snap b/.metadata/.plugins/org.eclipse.core.resources/1.snap index df2dd3e..e0f4dad 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/1.snap and b/.metadata/.plugins/org.eclipse.core.resources/1.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs index 0cc508a..b2acd9c 100644 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs @@ -1,2 +1,2 @@ eclipse.preferences.version=1 -org.eclipse.core.variables.valueVariables=\n\n +org.eclipse.core.variables.valueVariables=\r\n\r\n diff --git a/.metadata/.plugins/org.eclipse.debug.core/.launches/Insiemistica.launch b/.metadata/.plugins/org.eclipse.debug.core/.launches/Insiemistica.launch new file mode 100644 index 0000000..d90103d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.debug.core/.launches/Insiemistica.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.metadata/.plugins/org.eclipse.debug.core/.launches/IteratoreSenzaDuplicati.launch b/.metadata/.plugins/org.eclipse.debug.core/.launches/IteratoreSenzaDuplicati.launch new file mode 100644 index 0000000..8da1a89 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.debug.core/.launches/IteratoreSenzaDuplicati.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml b/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml index aa06296..1ac4ead 100644 --- a/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml +++ b/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml @@ -2,6 +2,7 @@ + @@ -19,6 +20,7 @@ + @@ -36,6 +38,7 @@ + diff --git a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi index 93384b2..5cd2fd8 100644 --- a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi +++ b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -1,8 +1,8 @@ - - + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration - + @@ -10,9 +10,9 @@ topLevel - - - + + + persp.actionSet:org.eclipse.mylyn.tasks.ui.navigation persp.actionSet:org.eclipse.ui.cheatsheets.actionSet @@ -79,175 +79,175 @@ persp.editorOnboardingCommand:Show Key Assist$$$Ctrl+Shift+L persp.editorOnboardingCommand:New$$$Ctrl+N persp.editorOnboardingCommand:Open Type$$$Ctrl+Shift+T - - - + + + org.eclipse.e4.primaryNavigationStack - noFocus - + View categoryTag:Java - + View categoryTag:Java - + View categoryTag:General - + View categoryTag:Java - - + + View categoryTag:Git - - - - - - - View - categoryTag:General - - - - + + + + org.eclipse.e4.secondaryNavigationStack Minimized - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Mylyn - + View categoryTag:Java - + View categoryTag:Ant - + org.eclipse.e4.secondaryDataStack Oomph - Minimized - + View categoryTag:General - + View categoryTag:Java - + View categoryTag:Java - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Terminal - + View categoryTag:Oomph NoRestore - + View categoryTag:Oomph NoRestore + + View + categoryTag:General + - - + + View categoryTag:Help - + View categoryTag:General - + View categoryTag:Help - + View categoryTag:Help - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:Help - - + + EditorStack org.eclipse.e4.primaryDataStack active noFocus - - + + Editor removeOnHide org.eclipse.jdt.ui.CompilationUnitEditor - - + + + Editor + removeOnHide + org.eclipse.jdt.ui.CompilationUnitEditor + + + Editor removeOnHide org.eclipse.jdt.ui.CompilationUnitEditor @@ -255,2293 +255,2293 @@ - + View categoryTag:Java - + ViewMenu menuContribution:menu - + - + View categoryTag:Java - + View categoryTag:General - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:Java - + View categoryTag:Java - + View categoryTag:General - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Mylyn - + View categoryTag:Terminal - + View categoryTag:Java - + View categoryTag:Git - + View categoryTag:Java - + View categoryTag:Ant - + View categoryTag:Oomph NoRestore - + ViewMenu menuContribution:menu - + - + View categoryTag:Oomph NoRestore - + ViewMenu menuContribution:menu - + - - + + toolbarSeparator - + - + Draggable - + - + toolbarSeparator - + - + Draggable - - + + - + toolbarSeparator - + - + Draggable - + Draggable - + Draggable - + Draggable - + toolbarSeparator - + - + Draggable - + - + Draggable - + toolbarSeparator - + - + toolbarSeparator - + - + Draggable - + stretch SHOW_RESTORE_MENU - + Draggable HIDEABLE SHOW_RESTORE_MENU - - + + stretch - + Draggable - + Draggable - - + + TrimStack Draggable - + TrimStack Draggable - - + + TrimStack Draggable - + TrimStack Draggable - + TrimStack Draggable - - - - - - + + + + + + platform:cocoa - + platform:cocoa - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + platform:win32 - - - + + + - - - - - - - - - + + + + + + + + + platform:cocoa - - - - - - - - - - - - - - + + + + + + + + + + + + + + platform:cocoa - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + - - - - - - - - + + + + + + + + - - - + + + - - - + + + - - - - - + + + + + - - + + - - - + + + - - - + + + - - - - - - - - - + + + + + + + + + - - + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - + + + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - + + platform:win32 - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - + + - - + + - - + + - - + + - - - + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - + + + + - - + + - - - - - - + + + + + + - - - - + + + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - + + + + + + + + + - - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor removeOnHide - + View categoryTag:Ant - + View categoryTag:Gradle - + View categoryTag:Gradle - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Java - + View categoryTag:Git - + View categoryTag:Git - + View categoryTag:Git - + View categoryTag:Git NoRestore - + View categoryTag:Git - + View categoryTag:Help - + View categoryTag:Java - + View categoryTag:Java - + View categoryTag:Debug - + View categoryTag:Java - + View categoryTag:Java - + View categoryTag:Java - + View categoryTag:Java Browsing - + View categoryTag:Java Browsing - + View categoryTag:Java Browsing - + View categoryTag:Java Browsing - + View categoryTag:Java - + View categoryTag:General - + View categoryTag:Java - + View categoryTag:Java - + View categoryTag:Language Servers - + View categoryTag:Language Servers - + View categoryTag:Language Servers - + View categoryTag:Maven - + View categoryTag:Maven - + View categoryTag:Maven - + View categoryTag:Mylyn - + View categoryTag:Mylyn - + View categoryTag:Mylyn - + View categoryTag:Mylyn - + View categoryTag:Mylyn - + View categoryTag:Mylyn - + View categoryTag:Oomph - + View categoryTag:Oomph NoRestore - + View categoryTag:Plug-in Development - + View categoryTag:General - + View categoryTag:Version Control (Team) - + View categoryTag:Version Control (Team) - + View categoryTag:Terminal - + View categoryTag:Help - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Help - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - - + + glue move_after:PerspectiveSpacer SHOW_RESTORE_MENU - + move_after:Spacer Glue HIDEABLE SHOW_RESTORE_MENU - + glue move_after:SearchField SHOW_RESTORE_MENU - - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.metadata/.plugins/org.eclipse.jdt.core/1865797976.index b/.metadata/.plugins/org.eclipse.jdt.core/1865797976.index index 91cf484..4c3a01e 100644 Binary files a/.metadata/.plugins/org.eclipse.jdt.core/1865797976.index and b/.metadata/.plugins/org.eclipse.jdt.core/1865797976.index differ diff --git a/.metadata/.plugins/org.eclipse.jdt.core/2876837992.index b/.metadata/.plugins/org.eclipse.jdt.core/2876837992.index index 230906e..8b59614 100644 Binary files a/.metadata/.plugins/org.eclipse.jdt.core/2876837992.index and b/.metadata/.plugins/org.eclipse.jdt.core/2876837992.index differ diff --git a/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt b/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt index 8058d71..7f28ed1 100644 --- a/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt +++ b/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt @@ -1,3 +1,4 @@ INDEX VERSION 1.134+C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.jdt.core +2555619149.index 1865797976.index 2876837992.index diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/0.png b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/0.png index 6630b18..f5c6e73 100644 Binary files a/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/0.png and b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/0.png differ diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/1.png b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/1.png index f5c6e73..a4446f4 100644 Binary files a/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/1.png and b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/1.png differ diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/2.png b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/2.png index 0302b8c..4210c2a 100644 Binary files a/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/2.png and b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/2.png differ diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/3.png b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/3.png new file mode 100644 index 0000000..0302b8c Binary files /dev/null and b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/3.png differ diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/4.png b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/4.png new file mode 100644 index 0000000..3ac89df Binary files /dev/null and b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/4.png differ diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/5.png b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/5.png new file mode 100644 index 0000000..dfbdbb0 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/5.png differ diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Crashpad/settings.dat b/.metadata/.plugins/org.eclipse.swt/EBWebView/Crashpad/settings.dat index cfa8d66..9f4511f 100644 Binary files a/.metadata/.plugins/org.eclipse.swt/EBWebView/Crashpad/settings.dat and b/.metadata/.plugins/org.eclipse.swt/EBWebView/Crashpad/settings.dat differ diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/AutofillAiModelCache/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/AutofillAiModelCache/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/AutofillStrikeDatabase/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/AutofillStrikeDatabase/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/BrowsingTopicsState b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/BrowsingTopicsState index aba5761..5bd322c 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/BrowsingTopicsState +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/BrowsingTopicsState @@ -8,5 +8,5 @@ "top_topics_and_observing_domains": [ ] } ], "hex_encoded_hmac_key": "3DA604280665A873D0EA6D316B3A72B9F419BDC719033123A3E96DBB0342BE2C", - "next_scheduled_calculation_time": "13423430092943167" + "next_scheduled_calculation_time": "13423430092943182" } diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/BudgetDatabase/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/BudgetDatabase/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Cache/Cache_Data/f_000001 b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Cache/Cache_Data/f_000003 similarity index 100% rename from .metadata/.plugins/org.eclipse.swt/EBWebView/Default/Cache/Cache_Data/f_000001 rename to .metadata/.plugins/org.eclipse.swt/EBWebView/Default/Cache/Cache_Data/f_000003 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Cache/No_Vary_Search/journal.baj b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Cache/No_Vary_Search/journal.baj index 54fe66e..e69de29 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Cache/No_Vary_Search/journal.baj +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Cache/No_Vary_Search/journal.baj @@ -1 +0,0 @@ -$F~ \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/ClientCertificates/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/ClientCertificates/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Code Cache/js/ca4476001c08c94c_0 b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Code Cache/js/ca4476001c08c94c_0 index 4300282..cec4d7f 100644 Binary files a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Code Cache/js/ca4476001c08c94c_0 and b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Code Cache/js/ca4476001c08c94c_0 differ diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Code Cache/js/index-dir/the-real-index b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Code Cache/js/index-dir/the-real-index index 152bf9c..552b36f 100644 Binary files a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Code Cache/js/index-dir/the-real-index and b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Code Cache/js/index-dir/the-real-index differ diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Extension State/LOG b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Extension State/LOG index 4aa92b3..e69de29 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Extension State/LOG +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Extension State/LOG @@ -1,2 +0,0 @@ -2026/05/09-20:34:50.298 1b8c Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Extension State since it was missing. -2026/05/09-20:34:50.301 1b8c Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Extension State/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Extension State/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Extension State/LOG.old new file mode 100644 index 0000000..4aa92b3 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Extension State/LOG.old @@ -0,0 +1,2 @@ +2026/05/09-20:34:50.298 1b8c Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Extension State since it was missing. +2026/05/09-20:34:50.301 1b8c Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Extension State/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Feature Engagement Tracker/AvailabilityDB/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Feature Engagement Tracker/AvailabilityDB/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Feature Engagement Tracker/EventDB/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Feature Engagement Tracker/EventDB/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/History b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/History index 80a0617..84fd546 100644 Binary files a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/History and b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/History differ diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/History-journal b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/History-journal index dc695e7..e69de29 100644 Binary files a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/History-journal and b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/History-journal differ diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Local Storage/leveldb/LOG b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Local Storage/leveldb/LOG index d69ea99..e69de29 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Local Storage/leveldb/LOG +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Local Storage/leveldb/LOG @@ -1,2 +0,0 @@ -2026/05/09-20:34:50.321 26dc Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Local Storage\leveldb since it was missing. -2026/05/09-20:34:50.334 26dc Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Local Storage/leveldb/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Local Storage/leveldb/LOG.old new file mode 100644 index 0000000..d69ea99 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Local Storage/leveldb/LOG.old @@ -0,0 +1,2 @@ +2026/05/09-20:34:50.321 26dc Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Local Storage\leveldb since it was missing. +2026/05/09-20:34:50.334 26dc Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Network/TransportSecurity b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Network/TransportSecurity index 000b189..ec578e0 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Network/TransportSecurity +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Network/TransportSecurity @@ -1 +1 @@ -{"sts":[{"expiry":1809887691.64094,"host":"Bb6CfwBW9xa4G2DyhI27lujzIm9QMX4njeP0qgg7n+Y=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1778351691.640946},{"expiry":1809887693.231472,"host":"5AUdaPrjbZpycMJSfvB4F6jmmAfkjR133lCOp+js4+E=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1778351693.23148},{"expiry":1809887692.184129,"host":"6Rxq1ifSWlOJhzOYYdWRhfgKRZ4jrGi2e5lJ0HKREHQ=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1778351692.184138}],"version":2} \ No newline at end of file +{"sts":[{"expiry":1809887691.64094,"host":"Bb6CfwBW9xa4G2DyhI27lujzIm9QMX4njeP0qgg7n+Y=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1778351691.640946},{"expiry":1809905543.007089,"host":"5AUdaPrjbZpycMJSfvB4F6jmmAfkjR133lCOp+js4+E=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1778369543.007089},{"expiry":1809887692.184129,"host":"6Rxq1ifSWlOJhzOYYdWRhfgKRZ4jrGi2e5lJ0HKREHQ=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1778351692.184138}],"version":2} \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/PersistentOriginTrials/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/PersistentOriginTrials/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Preferences b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Preferences index 0cece97..fc8b4f3 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Preferences +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Preferences @@ -1 +1 @@ -{"aadc_info":{"age_group":3},"accessibility":{"captions":{"headless_caption_enabled":false}},"account_tracker_service_last_update":"13422825290294571","autocomplete":{"retention_policy_last_version":147},"autofill":{"edge_autofill_advanced_ml_enabled":false,"edge_autofill_purge_low_quality_profiles_by_timeline":false,"last_version_deduped":147},"bookmark":{"storage_computation_last_update":"13422825290289708"},"browser":{"available_dark_theme_options":"All","recent_theme_color_list":[4293914607.0,4293914607.0,4293914607.0,4293914607.0,4293914607.0],"show_toolbar_edge_generic_sidebar_button":false,"theme":{"color_scheme2":2},"user_level_features_context":{}},"browser_content_container_height":67,"browser_content_container_width":602,"browser_content_container_x":0,"browser_content_container_y":0,"commerce_daily_metrics_last_update_time":"13422825290293315","countryid_at_install":18772,"credentials_enable_service":false,"edge":{"bookmarks":{"last_dup_info_record_time":"13422825300291938"},"msa_sso_info":{"allow_for_non_msa_profile":true},"profile_sso_info":{"is_msa_first_profile":true,"msa_sso_algo_state":1},"services":{"signin_scoped_device_id":"b0b18b5f-58ec-4478-824a-66782d76d37d"}},"edge_journeys":{"latest_journeys_count":0},"edge_rewards":{"cache_data":"CAA=","hva_webui_action_status_dict":{},"refresh_status_muted_until":"13423430090265996"},"edge_ux_config":{"assignmentcontext":"","dataversion":"0","experimentvariables":{},"flights":{}},"edge_vpn":{"available":true},"edge_wallet":{"passwords":{"password_lost_report_date":"13422825320278890"}},"enterprise_profile_guid":"c9c307cc-82a2-4be9-89c0-04edbd9e6415","extension":{"installed_extension_count":2},"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"147.0.3912.98","pdf_upsell_triggered":false,"pinned_extension_migration":true,"pinned_extensions":[]},"fsd":{"retention_policy_last_version":147},"gaia_cookie":{"periodic_report_time_2":"13422825290265802"},"intl":{"selected_languages":"en-GB,en,en-US"},"language_dwell_time_average":{"en":6.0},"language_model_counters":{"en":2},"language_usage_count":{"en":1},"media":{"engagement":{"schema_version":5}},"migrated_user_scripts_toggle":true,"muid":{"last_sync":"13422825290293161","values_seen":[]},"optimization_guide":{"hintsfetcher":{"hosts_successfully_fetched":{}},"previously_registered_optimization_types":{"ABOUT_THIS_SITE":true,"AUTOFILL_ACTOR_IFRAME_ORIGIN_ALLOWLIST":true,"GLIC_ACTION_PAGE_BLOCK":true,"HISTORY_CLUSTERS":true,"LOADING_PREDICTOR":true,"MERCHANT_TRUST_SIGNALS_V2":true,"PAGE_ENTITIES":true,"PRICE_TRACKING":true,"SALIENT_IMAGE":true,"SAVED_TAB_GROUP":true,"V8_COMPILE_HINTS":true}},"password_manager":{"account_store_backup_password_cleaning_last_timestamp":"13422825350282160","account_store_migrated_to_os_crypt_async":true,"profile_store_backup_password_cleaning_last_timestamp":"13422825350282713","profile_store_migrated_to_os_crypt_async":true},"personalization_data_consent":{"personalization_in_context_consent_can_prompt":true,"personalization_in_context_count":0},"privacy_sandbox":{"first_party_sets_data_access_allowed_initialized":true},"profile":{"avatar_index":20,"background_password_check":{"check_fri_weight":9,"check_interval":"2592000000000","check_mon_weight":6,"check_sat_weight":6,"check_sun_weight":6,"check_thu_weight":9,"check_tue_weight":9,"check_wed_weight":9,"next_check_time":"13424909115774370"},"content_settings":{"exceptions":{"3pcd_heuristics_grants":{},"abusive_notification_permissions":{},"access_to_get_all_screens_media_in_session":{},"anti_abuse":{},"app_banner":{},"ar":{},"are_suspicious_notifications_allowlisted_by_user":{},"auto_picture_in_picture":{},"auto_select_certificate":{},"automatic_downloads":{},"automatic_fullscreen":{},"autoplay":{},"background_sync":{},"bluetooth_chooser_data":{},"bluetooth_guard":{},"bluetooth_scanning":{},"camera_pan_tilt_zoom":{},"captured_surface_control":{},"clear_browsing_data_cookies_exceptions":{},"client_hints":{},"clipboard":{},"controlled_frame":{},"cookie_controls_metadata":{"file:///*,*":{"last_modified":"13422833074155307","setting":{}},"https://[*.]eclipse.org,*":{"last_modified":"13422825291369220","setting":{}}},"cookies":{},"direct_sockets":{},"direct_sockets_private_network_access":{},"display_media_system_audio":{},"disruptive_notification_permissions":{},"durable_storage":{},"edge_ad_targeting":{},"edge_ad_targeting_data":{},"edge_all_file_read_access":{},"edge_browser_action":{},"edge_sdsm":{},"edge_split_screen":{},"edge_tech_scam_detection":{},"edge_u2f_api_request":{},"edge_user_agent_token":{},"fedcm_idp_registration":{},"fedcm_idp_signin":{},"fedcm_share":{},"file_system_access_chooser_data":{},"file_system_access_extended_permission":{},"file_system_access_restore_permission":{},"file_system_last_picked_directory":{},"file_system_read_guard":{},"file_system_write_guard":{},"formfill_metadata":{},"geolocation":{},"geolocation_with_options":{},"hand_tracking":{},"has_migrated_local_network_access":true,"hid_chooser_data":{},"hid_guard":{},"http_allowed":{},"https_enforced":{},"idle_detection":{},"images":{},"important_site_info":{},"initialized_translations":{},"intent_picker_auto_display":{},"javascript":{},"javascript_jit":{},"javascript_optimizer":{},"keyboard_lock":{},"legacy_cookie_access":{},"legacy_cookie_scope":{},"local_fonts":{},"local_network":{},"local_network_access":{},"loopback_network":{},"media_engagement":{"https://www.eclipse.org:443,*":{"expiration":"13430601356398229","last_modified":"13422825356398233","lifetime":"7776000000000","setting":{"hasHighScore":false,"lastMediaPlaybackTime":0.0,"mediaPlaybacks":0,"visits":1}}},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"nfc_devices":{},"notification_interactions":{},"notification_permission_review":{},"notifications":{},"ondevice_languages_downloaded":{},"password_protection":{},"payment_handler":{},"permission_actions_history":{},"permission_autoblocking_data":{},"permission_autorevocation_data":{},"pointer_lock":{},"popups":{},"protected_media_identifier":{},"protocol_handler":{},"reduced_accept_language":{},"safe_browsing_url_check_data":{},"secure_network":{},"secure_network_sites":{},"sensors":{},"serial_chooser_data":{},"serial_guard":{},"site_engagement":{"https://www.eclipse.org:443,*":{"last_modified":"13422825291375756","setting":{"lastEngagementTime":1.3422825291375744e+16,"lastShortcutLaunchTime":0.0,"pointsAddedToday":4.5,"rawScore":4.5}}},"sleeping_tabs":{},"sound":{},"speaker_selection":{},"ssl_cert_decisions":{},"storage_access":{},"storage_access_header_origin_trial":{},"subresource_filter":{},"subresource_filter_data":{},"suspicious_notification_ids":{},"suspicious_notification_show_original":{},"top_level_storage_access":{},"trackers":{},"trackers_data":{},"tracking_org_exceptions":{},"tracking_org_relationships":{},"typosquatting":{},"unused_site_permissions":{},"usb_chooser_data":{},"usb_guard":{},"vr":{},"web_app_installation":{},"webid_api":{},"webid_auto_reauthn":{},"window_placement":{}},"pref_version":1},"created_by_version":"147.0.3912.98","creation_time":"13422825290227113","default_content_setting_values":{"has_migrated_local_network_access":true},"edge_password_is_using_new_login_db_path":false,"edge_password_login_db_path_flip_flop_count":0,"edge_profile_id":"a229742e-1a76-40e7-b7b9-b0cbc2f225f1","edge_user_with_non_zero_passwords":false,"has_seen_signin_fre":false,"is_relative_to_aad":false,"last_engagement_time":"13422825291375745","last_time_obsolete_http_credentials_removed":1778351750.282291,"last_time_password_store_metrics_reported":1778351720.277159,"managed_user_id":"","name":"Profile 1","network_pbs":{},"observed_session_time":{"feedback_rating_in_product_help_observed_session_time_key_147.0.3912.98":6.0},"password_hash_data_list":[],"signin_fre_seen_time":"13422825290260630","were_old_google_logins_removed":true},"reset_prepopulated_engines":false,"safety_hub":{"unused_site_permissions_revocation":{"migration_completed":true}},"saved_tab_groups":{"did_enable_shared_tab_groups_in_last_session":false,"specifics_to_data_migration":true},"sessions":{"event_log":[{"crashed":false,"time":"13422825290268704","type":0},{"did_schedule_command":false,"first_session_service":true,"tab_count":1,"time":"13422825356403533","type":2,"window_count":1}],"session_data_status":1},"signin":{"accounts_metadata_dict":{},"allowed":true},"spellcheck":{"dictionaries":["en-GB"]},"syncing_theme_prefs_migrated_to_non_syncing":true,"tab_search":{"pinned_to_tabstrip":false,"pinned_to_tabstrip_migration_complete":true},"total_passwords_available_for_account":0,"total_passwords_available_for_profile":0,"translate_site_blacklist":[],"translate_site_blocklist_with_time":{},"typosquatting":{"allowlist_migration_done":true},"user_experience_metrics":{"personalization_data_consent_enabled_last_known_value":false},"webrtc":{"udp_port_range":"0-0"}} \ No newline at end of file +{"aadc_info":{"age_group":3},"accessibility":{"captions":{"headless_caption_enabled":false}},"account_tracker_service_last_update":"13422825290294571","autocomplete":{"retention_policy_last_version":147},"autofill":{"edge_autofill_advanced_ml_enabled":false,"edge_autofill_purge_low_quality_profiles_by_timeline":false,"last_version_deduped":147},"bookmark":{"storage_computation_last_update":"13422825290289708"},"browser":{"available_dark_theme_options":"All","recent_theme_color_list":[4293914607.0,4293914607.0,4293914607.0,4293914607.0,4293914607.0],"show_toolbar_edge_generic_sidebar_button":false,"theme":{"color_scheme2":2},"user_level_features_context":{}},"browser_content_container_height":206,"browser_content_container_width":602,"browser_content_container_x":0,"browser_content_container_y":0,"commerce_daily_metrics_last_update_time":"13422825290293315","countryid_at_install":18772,"credentials_enable_service":false,"edge":{"bookmarks":{"last_dup_info_record_time":"13422825300291938"},"msa_sso_info":{"allow_for_non_msa_profile":true},"profile_sso_info":{"is_msa_first_profile":true,"msa_sso_algo_state":1},"services":{"signin_scoped_device_id":"96942901-4e8d-4038-904b-06675f324c33"}},"edge_journeys":{"latest_journeys_count":0},"edge_rewards":{"cache_data":"CAA=","coachmark_promotions":{},"hva_promotions":[],"hva_webui_action_status_dict":{},"refresh_status_muted_until":"13423430090265996"},"edge_ux_config":{"assignmentcontext":"","dataversion":"0","experimentvariables":{},"flights":{}},"edge_vpn":{"available":true},"edge_wallet":{"passwords":{"password_lost_report_date":"13422825320278890"}},"enterprise_profile_guid":"c9c307cc-82a2-4be9-89c0-04edbd9e6415","extension":{"installed_extension_count":2},"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"147.0.3912.98","pdf_upsell_triggered":false,"pinned_extension_migration":true,"pinned_extensions":[]},"fsd":{"retention_policy_last_version":147},"gaia_cookie":{"periodic_report_time_2":"13422825290265802"},"intl":{"selected_languages":"en-GB,en,en-US"},"language_dwell_time_average":{"en":6.0},"language_model_counters":{"en":4},"language_usage_count":{"en":1},"media":{"engagement":{"schema_version":5}},"migrated_user_scripts_toggle":true,"muid":{"last_sync":"13422825290293161","values_seen":[]},"optimization_guide":{"hintsfetcher":{"hosts_successfully_fetched":{}},"previously_registered_optimization_types":{"ABOUT_THIS_SITE":true,"AUTOFILL_ACTOR_IFRAME_ORIGIN_ALLOWLIST":true,"GLIC_ACTION_PAGE_BLOCK":true,"HISTORY_CLUSTERS":true,"LOADING_PREDICTOR":true,"MERCHANT_TRUST_SIGNALS_V2":true,"PAGE_ENTITIES":true,"PRICE_TRACKING":true,"SALIENT_IMAGE":true,"SAVED_TAB_GROUP":true,"V8_COMPILE_HINTS":true}},"password_manager":{"account_store_backup_password_cleaning_last_timestamp":"13422825350282160","account_store_migrated_to_os_crypt_async":true,"profile_store_backup_password_cleaning_last_timestamp":"13422825350282713","profile_store_migrated_to_os_crypt_async":true},"personalization_data_consent":{"personalization_in_context_consent_can_prompt":true,"personalization_in_context_count":0},"privacy_sandbox":{"first_party_sets_data_access_allowed_initialized":true},"profile":{"avatar_index":20,"background_password_check":{"check_fri_weight":9,"check_interval":"2592000000000","check_mon_weight":6,"check_sat_weight":6,"check_sun_weight":6,"check_thu_weight":9,"check_tue_weight":9,"check_wed_weight":9,"next_check_time":"13424909115774370"},"content_settings":{"exceptions":{"3pcd_heuristics_grants":{},"abusive_notification_permissions":{},"access_to_get_all_screens_media_in_session":{},"anti_abuse":{},"app_banner":{},"ar":{},"are_suspicious_notifications_allowlisted_by_user":{},"auto_picture_in_picture":{},"auto_select_certificate":{},"automatic_downloads":{},"automatic_fullscreen":{},"autoplay":{},"background_sync":{},"bluetooth_chooser_data":{},"bluetooth_guard":{},"bluetooth_scanning":{},"camera_pan_tilt_zoom":{},"captured_surface_control":{},"clear_browsing_data_cookies_exceptions":{},"client_hints":{},"clipboard":{},"controlled_frame":{},"cookie_controls_metadata":{"file:///*,*":{"last_modified":"13422847998511251","setting":{}},"https://[*.]eclipse.org,*":{"last_modified":"13422843141092695","setting":{}}},"cookies":{},"direct_sockets":{},"direct_sockets_private_network_access":{},"display_media_system_audio":{},"disruptive_notification_permissions":{},"durable_storage":{},"edge_ad_targeting":{},"edge_ad_targeting_data":{},"edge_all_file_read_access":{},"edge_browser_action":{},"edge_sdsm":{},"edge_split_screen":{},"edge_tech_scam_detection":{},"edge_u2f_api_request":{},"edge_user_agent_token":{},"fedcm_idp_registration":{},"fedcm_idp_signin":{},"fedcm_share":{},"file_system_access_chooser_data":{},"file_system_access_extended_permission":{},"file_system_access_restore_permission":{},"file_system_last_picked_directory":{},"file_system_read_guard":{},"file_system_write_guard":{},"formfill_metadata":{},"geolocation":{},"geolocation_with_options":{},"hand_tracking":{},"has_migrated_local_network_access":true,"hid_chooser_data":{},"hid_guard":{},"http_allowed":{},"https_enforced":{},"idle_detection":{},"images":{},"important_site_info":{},"initialized_translations":{},"intent_picker_auto_display":{},"javascript":{},"javascript_jit":{},"javascript_optimizer":{},"keyboard_lock":{},"legacy_cookie_access":{},"legacy_cookie_scope":{},"local_fonts":{},"local_network":{},"local_network_access":{},"loopback_network":{},"media_engagement":{"https://www.eclipse.org:443,*":{"expiration":"13430601356398229","last_modified":"13422825356398233","lifetime":"7776000000000","setting":{"hasHighScore":false,"lastMediaPlaybackTime":0.0,"mediaPlaybacks":0,"visits":1}}},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"nfc_devices":{},"notification_interactions":{},"notification_permission_review":{},"notifications":{},"ondevice_languages_downloaded":{},"password_protection":{},"payment_handler":{},"permission_actions_history":{},"permission_autoblocking_data":{},"permission_autorevocation_data":{},"pointer_lock":{},"popups":{},"protected_media_identifier":{},"protocol_handler":{},"reduced_accept_language":{},"safe_browsing_url_check_data":{},"secure_network":{},"secure_network_sites":{},"sensors":{},"serial_chooser_data":{},"serial_guard":{},"site_engagement":{"https://www.eclipse.org:443,*":{"last_modified":"13422843141094940","setting":{"lastEngagementTime":1.3422843141094928e+16,"lastShortcutLaunchTime":0.0,"pointsAddedToday":4.5,"rawScore":8.9415}}},"sleeping_tabs":{},"sound":{},"speaker_selection":{},"ssl_cert_decisions":{},"storage_access":{},"storage_access_header_origin_trial":{},"subresource_filter":{},"subresource_filter_data":{},"suspicious_notification_ids":{},"suspicious_notification_show_original":{},"top_level_storage_access":{},"trackers":{},"trackers_data":{},"tracking_org_exceptions":{},"tracking_org_relationships":{},"typosquatting":{},"unused_site_permissions":{},"usb_chooser_data":{},"usb_guard":{},"vr":{},"web_app_installation":{},"webid_api":{},"webid_auto_reauthn":{},"window_placement":{}},"pref_version":1},"created_by_version":"147.0.3912.98","creation_time":"13422825290227113","default_content_setting_values":{"has_migrated_local_network_access":true},"edge_password_is_using_new_login_db_path":false,"edge_password_login_db_path_flip_flop_count":0,"edge_profile_id":"a229742e-1a76-40e7-b7b9-b0cbc2f225f1","edge_user_with_non_zero_passwords":false,"has_seen_signin_fre":false,"is_relative_to_aad":false,"last_engagement_time":"13422843141094928","last_time_obsolete_http_credentials_removed":1778351750.282291,"last_time_password_store_metrics_reported":1778351720.277159,"managed_user_id":"","name":"Profile 1","network_pbs":{},"observed_session_time":{"feedback_rating_in_product_help_observed_session_time_key_147.0.3912.98":6.0},"password_hash_data_list":[],"signin_fre_seen_time":"13422825290260630","were_old_google_logins_removed":true},"reset_prepopulated_engines":false,"safety_hub":{"unused_site_permissions_revocation":{"migration_completed":true}},"saved_tab_groups":{"did_enable_shared_tab_groups_in_last_session":false,"specifics_to_data_migration":true},"sessions":{"event_log":[{"crashed":false,"time":"13422825290268704","type":0},{"did_schedule_command":false,"first_session_service":true,"tab_count":1,"time":"13422825356403533","type":2,"window_count":1},{"crashed":false,"time":"13422843140823994","type":0},{"did_schedule_command":false,"first_session_service":true,"tab_count":3,"time":"13422843168919448","type":2,"window_count":3}],"session_data_status":1},"signin":{"accounts_metadata_dict":{},"allowed":true},"spellcheck":{"dictionaries":["en-GB"]},"syncing_theme_prefs_migrated_to_non_syncing":true,"tab_search":{"pinned_to_tabstrip":false,"pinned_to_tabstrip_migration_complete":true},"total_passwords_available_for_account":0,"total_passwords_available_for_profile":0,"translate_site_blacklist":[],"translate_site_blocklist_with_time":{},"typosquatting":{"allowlist_migration_done":true},"user_experience_metrics":{"personalization_data_consent_enabled_last_known_value":false},"webrtc":{"udp_port_range":"0-0"}} \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Secure Preferences b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Secure Preferences index 310d72f..394374b 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Secure Preferences +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Secure Preferences @@ -1 +1 @@ -{"extensions":{"settings":{"dgiklkfkllikcanfonkcabmbdfmgleag":{"account_extension_type":0,"active_permissions":{"api":[],"explicit_host":[],"manifest_permissions":[],"scriptable_host":[]},"commands":{},"content_settings":[],"creation_flags":1,"disable_reasons":[],"events":[],"first_install_time":"13422825290276856","from_webstore":false,"incognito_content_settings":[],"incognito_preferences":{},"last_update_time":"13422825290276856","location":5,"manifest":{"content_capabilities":{"include_globs":["https://*excel.officeapps.live.com/*","https://*onenote.officeapps.live.com/*","https://*powerpoint.officeapps.live.com/*","https://*word-edit.officeapps.live.com/*","https://*excel.officeapps.live.com.mcas.ms/*","https://*onenote.officeapps.live.com.mcas.ms/*","https://*word-edit.officeapps.live.com.mcas.ms/*","https://*excel.partner.officewebapps.cn/*","https://*onenote.partner.officewebapps.cn/*","https://*powerpoint.partner.officewebapps.cn/*","https://*word-edit.partner.officewebapps.cn/*","https://*excel.gov.online.office365.us/*","https://*onenote.gov.online.office365.us/*","https://*powerpoint.gov.online.office365.us/*","https://*word-edit.gov.online.office365.us/*","https://*excel.dod.online.office365.us/*","https://*onenote.dod.online.office365.us/*","https://*powerpoint.dod.online.office365.us/*","https://*word-edit.dod.online.office365.us/*","https://*visio.partner.officewebapps.cn/*","https://*visio.gov.online.office365.us/*","https://*visio.dod.online.office365.us/*"],"matches":["https://*.officeapps.live.com/*","https://*.officeapps.live.com.mcas.ms/*","https://*.partner.officewebapps.cn/*","https://*.gov.online.office365.us/*","https://*.dod.online.office365.us/*","https://*.app.whiteboard.microsoft.com/*","https://*.whiteboard.office.com/*","https://*.app.int.whiteboard.microsoft.com/*","https://*.whiteboard.office365.us/*","https://*.dev.whiteboard.microsoft.com/*"],"permissions":["clipboardRead","clipboardWrite"]},"default_locale":"en","description":"This extension grants Microsoft web sites permission to read and write from the clipboard.","key":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCz4t/X7GeuP6GBpjmxndrjtzF//4CWeHlC68rkoV7hP3h5Ka6eX7ZMNlYJkSjmB5iRmPHO5kR1y7rGY8JXnRPDQh/CQNLVA7OsKeV6w+UO+vx8KGI+TrTAhzH8YGcMIsxsUjxtC4cBmprja+xDr0zVp2EMgqHu+GBKgwSRHTkDuwIDAQAB","manifest_version":2,"minimum_chrome_version":"77","name":"Microsoft Clipboard Extension","version":"1.0"},"path":"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\147.0.3912.98\\resources\\edge_clipboard","preferences":{},"regular_only_preferences":{},"was_installed_by_default":false,"was_installed_by_oem":false},"mhjfbmdgcfjbbpaeojofohoefgiehjai":{"account_extension_type":0,"active_permissions":{"api":["contentSettings","fileSystem","fileSystem.write","metricsPrivate","tabs","resourcesPrivate","pdfViewerPrivate","fileSystem.readFullPath","errorReporting","edgeLearningToolsPrivate","fileSystem.getCurrentEntry","edgePdfPrivate","edgeCertVerifierPrivate"],"explicit_host":["edge://resources/*","edge://webui-test/*"],"manifest_permissions":[],"scriptable_host":[]},"commands":{},"content_settings":[],"creation_flags":1,"disable_reasons":[],"events":[],"first_install_time":"13422825290276320","from_webstore":false,"incognito_content_settings":[],"incognito_preferences":{},"last_update_time":"13422825290276320","location":5,"manifest":{"content_security_policy":"script-src 'self' 'wasm-eval' blob: filesystem: chrome://resources chrome://webui-test; object-src * blob: externalfile: file: filesystem: data:; trusted-types edge-internal fast-html pdf-url edge-pdf-static-policy;","description":"","incognito":"split","key":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDN6hM0rsDYGbzQPQfOygqlRtQgKUXMfnSjhIBL7LnReAVBEd7ZmKtyN2qmSasMl4HZpMhVe2rPWVVwBDl6iyNE/Kok6E6v6V3vCLGsOpQAuuNVye/3QxzIldzG/jQAdWZiyXReRVapOhZtLjGfywCvlWq7Sl/e3sbc0vWybSDI2QIDAQAB","manifest_version":2,"mime_types":["application/pdf"],"mime_types_handler":"edge_pdf/index.html","name":"Microsoft Edge PDF Viewer","offline_enabled":true,"permissions":["errorReporting","chrome://resources/","chrome://webui-test/","contentSettings","metricsPrivate","edgeCertVerifierPrivate","edgeLearningToolsPrivate","edgePdfPrivate","pdfViewerPrivate","resourcesPrivate","tabs",{"fileSystem":["write","readFullPath","getCurrentEntry"]}],"version":"1","web_accessible_resources":["pdf_embedder.css"]},"path":"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\147.0.3912.98\\resources\\edge_pdf","preferences":{},"regular_only_preferences":{},"was_installed_by_default":false,"was_installed_by_oem":false}}},"protection":{"macs":{"browser":{"show_home_button":"EF8E04BCF6F7C232231E69DAE481170653D82ED686DDBF2991FEFD946EB7522E","show_home_button_encrypted_hash":"djEwHQx8SveJb8xGOaATCwFmyN24CqmE8ZFLwE7mweqpWXTSbr89fCYuO106poJFKmj2XCRKZqvuh526RfIX"},"default_search_provider_data":{"template_url_data":"FCFE985DC4470CDE6D77C27E055CB0622C9CC7AD6BC6B9E1847519F7B8DEE144","template_url_data_encrypted_hash":"djEw5/Ei4jUSJUUtThiR8UuZGNzlyhsQJGufzBAh9KNtiOdkCUHlSlj2DODDNJruIYAo+vUzHH49klqjNo/O"},"edge":{"services":{"account_id":"CEF02DAD6F29EDA114575937C8F508621AE39F5C2738FAEDF89FCBB71E1C1BA3","account_id_encrypted_hash":"djEwdnn9cJcoSEEoW/R+rENLLu19nVmKfxS//aeuMoQtCpwqrxz36UvKMLFI0ZfhbkCgOZX/N+gOXyDP7vgj","last_username":"103B84FBAB0098687AD51A1C08493EFDAEB5F7EF6D86BBE2F39A61127527FBB7","last_username_encrypted_hash":"djEwiHRac2JsRhhxf/9xYISMNkGOkvIVqiGFllUT6s/eaBR5ZitrfG8nl8IsqoSpQXhGcuNsbDFgT113buHE"}},"enterprise_signin":{"policy_recovery_token":"CD42B0D9C6B42377D8101DB574DD3166F3A9E94F1DB639394916929D5EF5DAC2","policy_recovery_token_encrypted_hash":"djEwdgr2jKWS4XekwUmKD6TcIQoVqJxN6Q8+NqoA4wqN8AGzvoy/i3raYoJCzoCuD5OoeaoOnvHiOqdR1Kr+"},"extensions":{"install":{"initiallist":"3E78B078F98B045DFE906AB9531C92D6208035B4C12DBA309EFB5E15958EB4A5","initiallist_encrypted_hash":"djEwVL4GTh+WdlBvzILGd5h0xRF3ebs5s+z+O2Ayp4O12xhqTwCzYiKfzvIZ7tJD+fECQ0o5quSPBQsisrdU","initialprovidername":"40E3B3529940888791F691E760B354D1975C4DE1C69D4F79D038D1E6E57213DF","initialprovidername_encrypted_hash":"djEw4bsnYS1AoOZ8GcoM2SXdCL+cg59OEPEoNZB/1VVFEapY1ZvIW+pWxVBpnZu3WEfEGWthpQmCgzi+qEzw"},"settings":{"dgiklkfkllikcanfonkcabmbdfmgleag":"DA5FA348ACCFF784D34BB92F5675EE2FB160B53982751D3826CC007363E8284B","mhjfbmdgcfjbbpaeojofohoefgiehjai":"E5EC068D6C43F3F738FE1B38C3A7D681AD40CE86A10355B79FC06F895BAC9828"},"settings_encrypted_hash":{"dgiklkfkllikcanfonkcabmbdfmgleag":"djEwaylfjCDlijtzAkjK3DfxZm4M6Zr6b7C+vROE6J2O1azz2UMU5ncKKhEyi8+wEJx33c+cDADXua9x47qz","mhjfbmdgcfjbbpaeojofohoefgiehjai":"djEwWUQycKOAB1fDdK7cLL43HhqnJM5N5KFlKGyUXWEqqcJfzDOF7aLzCWzpwb5FRWAwkyeBOTJrwueX8qtI"},"ui":{"developer_mode":"2DBEBCCD41AA2009A8A787B8BD6D40749D4BAE6F5B4C817F2185B896E17E2F88","developer_mode_encrypted_hash":"djEwgpqGfTzK6Os4SB+mthwgzGEiFzyHH1ZpsyJeMELqIw3AZNYrrbn4qF7XyIlm9LFz8xxvUkamfa3jSZK8"}},"google":{"services":{"last_signed_in_username":"072FB2F17167EF75B4CFC99246F44C08AC2BBEF6A9E38CE03B2024A42C23FE84","last_signed_in_username_encrypted_hash":"djEwQTitK3O2Q/fIJhx6HCZ03yfCw8ARQtQanfmLFsukeCovlCigFINh/OttmB5ZRb+Itrr0HbyG87ja9/ax"}},"homepage":"78069B504433DDA1B1E463C057E727B790FEF1FCC64CAB5672F563FF4BE366FF","homepage_encrypted_hash":"djEwzzRAUlLm9piyM4VV89n1AyGXof2gRNqQeN9trGlk4+qxI+KF7jp8OrEfa7GJso19yWs6/HIxG5KclIbK","homepage_is_newtabpage":"F733D8383D60B3033BE28BA305EECEDE724D34C8FD94B30025F423B51393A590","homepage_is_newtabpage_encrypted_hash":"djEwp5mdJY5vkiE+zdMtylc3gwbBfbPZF6Ojibixg4axFTWN1wF8RS0TDAhHR5ki/SImY3krWwbOgHrrOysu","media":{"cdm":{"origin_data":"D37EC83B68B1EF5650F106F4A24081A49B4DF9F5678E7EC6A85E161A98A08E4B","origin_data_encrypted_hash":"djEwP4Tvl15NpWkD1EZY8+MtMaMWoZb45XZMyaMCBQcTwGwCvSxBALOutMz8uk338SGr/kjLTzZaDnGHAAqx"},"storage_id_salt":"B2E9290C6F6859BEB974309F06D9E137958B4AE07302B17AAE243C417F7EA569","storage_id_salt_encrypted_hash":"djEwfigsapvkNqfubawpfjBuJrjREa/B9ReMbUrNVVf8Yfu6rDx6t08GXV49QbdNznNJlFfTtPKWvpJK0i+F"},"pinned_tabs":"6EE16DC2F5850603ED8BDEA03AEFF18B572EE9FFFBC60EA1A9EED8FA68C0F5DB","pinned_tabs_encrypted_hash":"djEwyqc4kW3oWvSUPyFzIDxFuY8h7rVQbu4jAzblNYxT3AyUPuznYws7Yeni4fqf1nfHotJhsT/RWqCyQgOH","prefs":{"preference_reset_time":"15C19F277D4917DCF71B31F461B2D0C8DBB3B848428CA9BC3C5C6BC48574AC87","preference_reset_time_encrypted_hash":"djEw2QM6wX04l9DICverUX6jvkY3udM1DspK0SSLY6QZtBBmjGX5GYnBa2saOAuQVcx3Wl0ga62gJp4sL//e"},"safebrowsing":{"incidents_sent":"939F8A46FD612B2F11302FE860AA28AC2BB97403B61A579D55FF125171603A19","incidents_sent_encrypted_hash":"djEwssX+vwAs9DY/FaEHKsGOGEHxznmLFgfBH0OvAOSQZMj/vdgRVxvsm5i051F/RwsXzkpf9XgYffGqHV+a"},"schedule_to_flush_to_disk":"360F510301BEF8915F3F2C9138FB512F509516562B56EA3482C24AF4A22C0170","schedule_to_flush_to_disk_encrypted_hash":"djEwfMgVY+/jnt8RKp3XiXlMCxUHay0DvWc91A4/YvTooFLHQwKDD7YCmcYs/plBZ474TnUzVF79dahwRNDh","search_provider_overrides":"F89D61352813CEF1214763E778885A6264DB78F18556CF125DB7E7269A975DEA","search_provider_overrides_encrypted_hash":"djEwgoyNns9LmYxVyuD+iVt0JCbV46yrFXrLd+d1YbJxfEak+yS/LOT5shdLHYHiEWVSeqnAkTGn7kR/3wOH","session":{"restore_on_startup":"01D0DC40F4692ABDB2D5ACF617641F9F792DFAF368CDC870D173736D7C3A2DF1","restore_on_startup_encrypted_hash":"djEwW/GlFjuZL7QrhEltKSg0EgiNFfsOfvZGHtakts6sOTy7+pb9O6iYsVoqDg2Pdh6NqEheLVBy5x7tZ/jY","startup_urls":"D1197E0D92DA48044470C7DAA2988BB7F626A57B23FF417848ECDAC833189798","startup_urls_encrypted_hash":"djEw35w8shg8tEpt8JLwjttZsbp4vVsPwVLklogTm0H8vdE/DcBSPF55ZHfHAy84WyKAhDmLkgN8C7ux9/sy"}},"super_mac":"C413D71C7C90470BB389A7A7A06AE3CDE414BE39BBF085A3ECE7A642DCBB1959"},"schedule_to_flush_to_disk":"13422825290289569"} \ No newline at end of file +{"extensions":{"settings":{"dgiklkfkllikcanfonkcabmbdfmgleag":{"account_extension_type":0,"active_permissions":{"api":[],"explicit_host":[],"manifest_permissions":[],"scriptable_host":[]},"commands":{},"content_settings":[],"creation_flags":1,"disable_reasons":[],"events":[],"first_install_time":"13422825290276856","from_webstore":false,"incognito_content_settings":[],"incognito_preferences":{},"last_update_time":"13422825290276856","location":5,"manifest":{"content_capabilities":{"include_globs":["https://*excel.officeapps.live.com/*","https://*onenote.officeapps.live.com/*","https://*powerpoint.officeapps.live.com/*","https://*word-edit.officeapps.live.com/*","https://*excel.officeapps.live.com.mcas.ms/*","https://*onenote.officeapps.live.com.mcas.ms/*","https://*word-edit.officeapps.live.com.mcas.ms/*","https://*excel.partner.officewebapps.cn/*","https://*onenote.partner.officewebapps.cn/*","https://*powerpoint.partner.officewebapps.cn/*","https://*word-edit.partner.officewebapps.cn/*","https://*excel.gov.online.office365.us/*","https://*onenote.gov.online.office365.us/*","https://*powerpoint.gov.online.office365.us/*","https://*word-edit.gov.online.office365.us/*","https://*excel.dod.online.office365.us/*","https://*onenote.dod.online.office365.us/*","https://*powerpoint.dod.online.office365.us/*","https://*word-edit.dod.online.office365.us/*","https://*visio.partner.officewebapps.cn/*","https://*visio.gov.online.office365.us/*","https://*visio.dod.online.office365.us/*"],"matches":["https://*.officeapps.live.com/*","https://*.officeapps.live.com.mcas.ms/*","https://*.partner.officewebapps.cn/*","https://*.gov.online.office365.us/*","https://*.dod.online.office365.us/*","https://*.app.whiteboard.microsoft.com/*","https://*.whiteboard.office.com/*","https://*.app.int.whiteboard.microsoft.com/*","https://*.whiteboard.office365.us/*","https://*.dev.whiteboard.microsoft.com/*"],"permissions":["clipboardRead","clipboardWrite"]},"default_locale":"en","description":"This extension grants Microsoft web sites permission to read and write from the clipboard.","key":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCz4t/X7GeuP6GBpjmxndrjtzF//4CWeHlC68rkoV7hP3h5Ka6eX7ZMNlYJkSjmB5iRmPHO5kR1y7rGY8JXnRPDQh/CQNLVA7OsKeV6w+UO+vx8KGI+TrTAhzH8YGcMIsxsUjxtC4cBmprja+xDr0zVp2EMgqHu+GBKgwSRHTkDuwIDAQAB","manifest_version":2,"minimum_chrome_version":"77","name":"Microsoft Clipboard Extension","version":"1.0"},"path":"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\147.0.3912.98\\resources\\edge_clipboard","preferences":{},"regular_only_preferences":{},"was_installed_by_default":false,"was_installed_by_oem":false},"mhjfbmdgcfjbbpaeojofohoefgiehjai":{"account_extension_type":0,"active_permissions":{"api":["contentSettings","fileSystem","fileSystem.write","metricsPrivate","tabs","resourcesPrivate","pdfViewerPrivate","fileSystem.readFullPath","errorReporting","edgeLearningToolsPrivate","fileSystem.getCurrentEntry","edgePdfPrivate","edgeCertVerifierPrivate"],"explicit_host":["edge://resources/*","edge://webui-test/*"],"manifest_permissions":[],"scriptable_host":[]},"commands":{},"content_settings":[],"creation_flags":1,"disable_reasons":[],"events":[],"first_install_time":"13422825290276320","from_webstore":false,"incognito_content_settings":[],"incognito_preferences":{},"last_update_time":"13422825290276320","location":5,"manifest":{"content_security_policy":"script-src 'self' 'wasm-eval' blob: filesystem: chrome://resources chrome://webui-test; object-src * blob: externalfile: file: filesystem: data:; trusted-types edge-internal fast-html pdf-url edge-pdf-static-policy;","description":"","incognito":"split","key":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDN6hM0rsDYGbzQPQfOygqlRtQgKUXMfnSjhIBL7LnReAVBEd7ZmKtyN2qmSasMl4HZpMhVe2rPWVVwBDl6iyNE/Kok6E6v6V3vCLGsOpQAuuNVye/3QxzIldzG/jQAdWZiyXReRVapOhZtLjGfywCvlWq7Sl/e3sbc0vWybSDI2QIDAQAB","manifest_version":2,"mime_types":["application/pdf"],"mime_types_handler":"edge_pdf/index.html","name":"Microsoft Edge PDF Viewer","offline_enabled":true,"permissions":["errorReporting","chrome://resources/","chrome://webui-test/","contentSettings","metricsPrivate","edgeCertVerifierPrivate","edgeLearningToolsPrivate","edgePdfPrivate","pdfViewerPrivate","resourcesPrivate","tabs",{"fileSystem":["write","readFullPath","getCurrentEntry"]}],"version":"1","web_accessible_resources":["pdf_embedder.css"]},"path":"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\147.0.3912.98\\resources\\edge_pdf","preferences":{},"regular_only_preferences":{},"was_installed_by_default":false,"was_installed_by_oem":false}}},"protection":{"macs":{"browser":{"show_home_button":"EF8E04BCF6F7C232231E69DAE481170653D82ED686DDBF2991FEFD946EB7522E","show_home_button_encrypted_hash":"djEwLi+jbhkvR/7o+ozNw32Xi/C4uDywQB2+IprpNRZteJQknkgDJXj+HEABz1/1O4TcJmHT2iqhhtXIr6UX"},"default_search_provider_data":{"template_url_data":"FCFE985DC4470CDE6D77C27E055CB0622C9CC7AD6BC6B9E1847519F7B8DEE144","template_url_data_encrypted_hash":"djEwI7hlU3MO78qIPqf6/bXTKV9KIUA5O1GBadCdtgF92Adm2+zbt3+BMKzr550jJQ9hiAi4334BKSc1ZOkM"},"edge":{"services":{"account_id":"CEF02DAD6F29EDA114575937C8F508621AE39F5C2738FAEDF89FCBB71E1C1BA3","account_id_encrypted_hash":"djEwWLxOYQFfq9Lkvsy5T9zhSHv/mYFO8gwvm2GJM7y5F1a7tV2urfEcan8wZ3UkNRTAiS1kAI/Hz6bbtakg","last_username":"103B84FBAB0098687AD51A1C08493EFDAEB5F7EF6D86BBE2F39A61127527FBB7","last_username_encrypted_hash":"djEwmLGVmaQs5CfY6R3LQle4n2ZbdTrjsxMMClWoQtJv07LfiJWvateA/dm/VAM1KJTLrlvvWsDB9zp5I91H"}},"enterprise_signin":{"policy_recovery_token":"CD42B0D9C6B42377D8101DB574DD3166F3A9E94F1DB639394916929D5EF5DAC2","policy_recovery_token_encrypted_hash":"djEwj5mQhQZF5IJ0r0Ih577V7I9NYeR1KlMIZSogM5rI0Jlbrosy9YDX8NK0OE0LYFr3XBhguxwdXdqvyUWn"},"extensions":{"install":{"initiallist":"3E78B078F98B045DFE906AB9531C92D6208035B4C12DBA309EFB5E15958EB4A5","initiallist_encrypted_hash":"djEwZ2yNjJz9d+JMCs1vCLJObwMKPyoddma9ibLj3/xMs9uT8U6v5Aptlmq8lgjCXVCZSo/mayur5QsYwpdY","initialprovidername":"40E3B3529940888791F691E760B354D1975C4DE1C69D4F79D038D1E6E57213DF","initialprovidername_encrypted_hash":"djEwyD3gyoMYOcwgvfPMX5EhF0FaFQo8ZDDQSQ3AaNOPjfIKs+0G771q83p57UY03l8IvCHO1uJOj7K2/GB+"},"settings":{"dgiklkfkllikcanfonkcabmbdfmgleag":"DA5FA348ACCFF784D34BB92F5675EE2FB160B53982751D3826CC007363E8284B","mhjfbmdgcfjbbpaeojofohoefgiehjai":"E5EC068D6C43F3F738FE1B38C3A7D681AD40CE86A10355B79FC06F895BAC9828"},"settings_encrypted_hash":{"dgiklkfkllikcanfonkcabmbdfmgleag":"djEwiGy7a51yq+hD6c6xadWuwx9rELTr2r9w4BnfUyZYmkC0K54gdKK9TsKXHhXJTf1f8fPerufA2SY9Uuin","mhjfbmdgcfjbbpaeojofohoefgiehjai":"djEwnOqCu5FwMC4huWa7aCYIaWMhIR7ZG+GED7Af8M7xo8psJ8YML5SFTyMqSvwZGpAsLLx3O0XJMgmqDO5W"},"ui":{"developer_mode":"2DBEBCCD41AA2009A8A787B8BD6D40749D4BAE6F5B4C817F2185B896E17E2F88","developer_mode_encrypted_hash":"djEw/sWtRidEbHytQ7wib8ET8T5HJvgxvYZ254rooDVgUQoAfY65Su8l6exqTUKPndvaHgSSl3x9SoFoc4hl"}},"google":{"services":{"last_signed_in_username":"072FB2F17167EF75B4CFC99246F44C08AC2BBEF6A9E38CE03B2024A42C23FE84","last_signed_in_username_encrypted_hash":"djEwWefUrCH+g33ZkbLBD3YB6MSEUyZcddEtmpm2kHiPhb3jd6AHphlGEIY/5hIPqVgv4VAbz2kQeVde5o9Y"}},"homepage":"78069B504433DDA1B1E463C057E727B790FEF1FCC64CAB5672F563FF4BE366FF","homepage_encrypted_hash":"djEw+zx3WX3fhEL0sAn1QUIgryJYjb5vvO8G+DxTyPfhf0msBYxvtajcosVHr3jYOczT8BURr7vLCstbEIoJ","homepage_is_newtabpage":"F733D8383D60B3033BE28BA305EECEDE724D34C8FD94B30025F423B51393A590","homepage_is_newtabpage_encrypted_hash":"djEwI105gH2bzkFk3eDA/hcH3Q53O+rFhV01EDwTUi5SbF2BvbUikM35RO799ft0KNrVCUItS53FfXJUtD6p","media":{"cdm":{"origin_data":"D37EC83B68B1EF5650F106F4A24081A49B4DF9F5678E7EC6A85E161A98A08E4B","origin_data_encrypted_hash":"djEwerkxbZSmyLYMn4VGTu6YkHr3p3WeIfGI/u3/DGtOsjoJoShTRReQzdLL6MW0yeFVkxZjr+Z21lzuLyBn"},"storage_id_salt":"B2E9290C6F6859BEB974309F06D9E137958B4AE07302B17AAE243C417F7EA569","storage_id_salt_encrypted_hash":"djEwsG2oEG4aehwiUI0vxi86orz5tRl9Tws/x57pqiO9pbFBKVqisJmtD/TnYqB82pBvxjlbD9M7JnTZgAGQ"},"pinned_tabs":"6EE16DC2F5850603ED8BDEA03AEFF18B572EE9FFFBC60EA1A9EED8FA68C0F5DB","pinned_tabs_encrypted_hash":"djEwQeLfu6gvGd74o46JhQnIlIT/pjcNKzwVArfmxhRBZHv/tumbr2YI3kN4BJ0YS5BnONBkbpXPfjQ4zI6J","prefs":{"preference_reset_time":"15C19F277D4917DCF71B31F461B2D0C8DBB3B848428CA9BC3C5C6BC48574AC87","preference_reset_time_encrypted_hash":"djEwRqWrKUaHjYoL3TwBx0Ur72NIdG9lp1O+KeTAUJaoxvIwa3A7xMpLkYZU8aeaOufvofRGPrjzYfdfGRJz"},"safebrowsing":{"incidents_sent":"939F8A46FD612B2F11302FE860AA28AC2BB97403B61A579D55FF125171603A19","incidents_sent_encrypted_hash":"djEw9lRYbXo1ECRABI4SdTISNQLkJLzqgZR34UcQyUTm0hyg9u/9NcF8zCTFqJsv8H0pT3fD3Ou4nMIrEvgr"},"schedule_to_flush_to_disk":"E338965BF58D80E500083209C29838A87B0CEC393547ED6D5B328F04290C3BBB","schedule_to_flush_to_disk_encrypted_hash":"djEwLapIDql5tB5wghUkLg0pFu098eDhsxn2TfHMCLUpkg66lWMTpT4tgFOQDuabg33qRZR0d56CXwgoCkuk","search_provider_overrides":"F89D61352813CEF1214763E778885A6264DB78F18556CF125DB7E7269A975DEA","search_provider_overrides_encrypted_hash":"djEwxDhudWw5e2plQnxwmk2EAJq23SPWpsYfyEnO/pQc7kX4AxIKGX/A1PxtbCLiXj3lgp+c8MzbWlzB5rQ/","session":{"restore_on_startup":"01D0DC40F4692ABDB2D5ACF617641F9F792DFAF368CDC870D173736D7C3A2DF1","restore_on_startup_encrypted_hash":"djEwjvPMfR1nxvFXpZ3xKnnS7khth7BvuAZvn3YL2SjvCj4XbbnCZ1yqCW2pleFGluYrEwTEXssdQzZiKiIx","startup_urls":"D1197E0D92DA48044470C7DAA2988BB7F626A57B23FF417848ECDAC833189798","startup_urls_encrypted_hash":"djEwTZ/PJ9et6/eEs3QAbr5DACWzSLTuD4Y6Yd+b5sehto7iQd43adMRyMmMmM9Cr6qfXoaEX9Ngk+cZsiax"}},"super_mac":"66A83DD995FAF40E0DE573A096B0053EC6C1F58E05400E97BB80D443C9DDB147"},"schedule_to_flush_to_disk":"13422843140836810"} \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Session Storage/LOG b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Session Storage/LOG index 6f6ff2a..e69de29 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Session Storage/LOG +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Session Storage/LOG @@ -1,2 +0,0 @@ -2026/05/09-20:34:51.238 26dc Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Session Storage since it was missing. -2026/05/09-20:34:51.244 26dc Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Session Storage/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Session Storage/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Session Storage/LOG.old new file mode 100644 index 0000000..6f6ff2a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Session Storage/LOG.old @@ -0,0 +1,2 @@ +2026/05/09-20:34:51.238 26dc Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Session Storage since it was missing. +2026/05/09-20:34:51.244 26dc Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Session Storage/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Site Characteristics Database/LOG b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Site Characteristics Database/LOG index 5b40512..e69de29 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Site Characteristics Database/LOG +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Site Characteristics Database/LOG @@ -1,2 +0,0 @@ -2026/05/09-20:34:50.273 249c Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Site Characteristics Database since it was missing. -2026/05/09-20:34:50.276 249c Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Site Characteristics Database/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Site Characteristics Database/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Site Characteristics Database/LOG.old new file mode 100644 index 0000000..5b40512 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Site Characteristics Database/LOG.old @@ -0,0 +1,2 @@ +2026/05/09-20:34:50.273 249c Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Site Characteristics Database since it was missing. +2026/05/09-20:34:50.276 249c Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Site Characteristics Database/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Sync Data/LevelDB/LOG b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Sync Data/LevelDB/LOG index 6410891..e69de29 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Sync Data/LevelDB/LOG +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Sync Data/LevelDB/LOG @@ -1,2 +0,0 @@ -2026/05/09-20:34:50.269 344c Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Sync Data\LevelDB since it was missing. -2026/05/09-20:34:50.272 344c Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Sync Data\LevelDB/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Sync Data/LevelDB/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Sync Data/LevelDB/LOG.old new file mode 100644 index 0000000..6410891 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/Sync Data/LevelDB/LOG.old @@ -0,0 +1,2 @@ +2026/05/09-20:34:50.269 344c Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Sync Data\LevelDB since it was missing. +2026/05/09-20:34:50.272 344c Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\Sync Data\LevelDB/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/commerce_subscription_db/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/commerce_subscription_db/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/discount_infos_db/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/discount_infos_db/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/discounts_db/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/discounts_db/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/favorites_diagnostic.log b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/favorites_diagnostic.log index 420afdd..6d4bd06 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/favorites_diagnostic.log +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/favorites_diagnostic.log @@ -1 +1,2 @@ 2026-05-09 18:34:50.289: [INFO] OnDoneLoading sync enabled: 0 +2026-05-09 23:32:20.836: [INFO] OnDoneLoading sync enabled: 0 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/optimization_guide_hint_cache_store/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/optimization_guide_hint_cache_store/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/parcel_tracking_db/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/parcel_tracking_db/LOG.old new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/LOG b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/LOG index 96fcbff..e69de29 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/LOG +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/LOG @@ -1,2 +0,0 @@ -2026/05/09-20:34:50.297 228c Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\shared_proto_db since it was missing. -2026/05/09-20:34:50.299 228c Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\shared_proto_db/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/LOG.old new file mode 100644 index 0000000..96fcbff --- /dev/null +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/LOG.old @@ -0,0 +1,2 @@ +2026/05/09-20:34:50.297 228c Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\shared_proto_db since it was missing. +2026/05/09-20:34:50.299 228c Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\shared_proto_db/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/metadata/LOG b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/metadata/LOG index 53563b4..e69de29 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/metadata/LOG +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/metadata/LOG @@ -1,2 +0,0 @@ -2026/05/09-20:34:50.293 228c Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\shared_proto_db\metadata since it was missing. -2026/05/09-20:34:50.296 228c Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\shared_proto_db\metadata/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/metadata/LOG.old b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/metadata/LOG.old new file mode 100644 index 0000000..53563b4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Default/shared_proto_db/metadata/LOG.old @@ -0,0 +1,2 @@ +2026/05/09-20:34:50.293 228c Creating DB C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\shared_proto_db\metadata since it was missing. +2026/05/09-20:34:50.296 228c Reusing MANIFEST C:\Users\eslusarz\Documents\eclipse-workspace\.metadata\.plugins\org.eclipse.swt\EBWebView\Default\shared_proto_db\metadata/MANIFEST-000001 diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Local State b/.metadata/.plugins/org.eclipse.swt/EBWebView/Local State index 45f02f9..813035f 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Local State +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Local State @@ -1 +1 @@ -{"accessibility":{"captions":{"common_models_path":"","soda_translation_binary_path":""}},"autofill":{"ablation_seed":"FivBD7Ft8QE="},"breadcrumbs":{"enabled":true,"enabled_time":"13422825290225753"},"default_browser":{"browser_name_enum":6},"desktop_session_duration_tracker":{"last_session_end_timestamp":"1778351759"},"domain_actions_config":"H4sIAAAAAAAAAL1abW8bNxL+K4ZwH5LCWitJm975EASFkUMKNGiQS9ED6p4wS452JyI5NMnV7rrJfz9QL7Y2Wq2XcnAfLEujeWbI4exwXvTXREg95xU6RxInl39NwFpFAgKx8ZPLP7YElHPLikQ7uZz8alT7prHs8b2C9gOCbCfnE8kayEwuJ2Wlqkywnnw5TwfrypPIIgpPlhFWWctVqPLTRXhFptig/zyfrFGEG3MY0HhUQGht/DKS3JoUlR8gfieJKzJ4D7ijRHUrdJ7YTC6ffTmfCJYoEg/oLUl8t3iLK3EV0V/Z5gHjDoANmYBG8qBhDvHbPe4Te7apo2XmZBQZTHVIG36twv5KwdqscKA1ONUOeMEB0Jfg0DKZcBpqKhcpQMNxW5nnsQBFqyGvPuDnxYLECYgXL384GZRpAT7TfjTYoHSn7ctgGIsQiiuZaRKOPS9Gw9YGT1ATELS/V3Oi71WjjSdYazbR39kVY0E15lldQvARl7BCwZYUJ20KJA/G4UOAExnQ6BWBWUHSFsCKKmkHogQHIqBLWVYJobBpahRUElN0cIkuybQS0QKlOEpEqFQVHnGZaUyGpKghSNsIKlyhUZD7jEYHWw1uKdi2CYeiMSS5o67cIkV8a8h8ggSE+btJ2DGHND+36KzChkKKjSwnea116NGETQKQosaR1ymmuqlIqTwtvN3UaBJUONS8wiwf7beuMjW0OukZ9JXhhDX51oQSPUGCnwRsgmAXsElZWO0oulcCouWhUuKA/RYspSnY3WgnXdiBloGT4lZ+V1aM4y+Yi8FK6ABRWT9ct2wQPQl4zO3DfEEqoJuzmfNiMfc1BVGOy8KvNhL+tRbQCVpd2x5ZWBd+sD4UNrEqeK+AzEdswm8ffvGx+OoUqWAKroLPHrLwoJR4zT9OglcgBjxoELsAgTkPOeAgvMb18k8FU0PmRPDNzcla86GIM4xlJ+NV4k/Eh5rCYPQaREvygp0cfAL6BGxr5zdX7yNhzRG2HIfPCEmV+IxsOxgOF9SgfPPuTSd1wLBQNGDvMWgfKkk8YPRBIdt2kIZbjs6WfbLfQEi1fLyQR29GHsmPx0vAIzXieAkL91gJZB4t4UhlnXAY8A2OM8tPscVemzAZyxYNScHGoAixIIfbymGNuaeAftNyOBIo+uTuOo87ou7pJZKGAucaCkOLdu6wwCYxXiiu0XfaI5GQfde/f8yhJV106rAN6RhCOKDCK/LdJO2OegwX9G0nVuvbo5zgCuxmcWvKMf4897H06PRBd7RjGEsmOOzugTJLJu78qLdEhwiQK+wWDJ5u0WUctiqPwoFcbvKvfFyAKAdSE40GnOwcqJAm25DF4GW184QVqCp+vr5+HVf66omWnxv19GzzqWnUfgv83iF2MD9VT66v5XdPz/xUPXs5m+2zd7xhh5i/mM2aF7PZ9XV2Nn/2fDZr/jGbZfuwjTPc8Wu5Zm1Ul2nnBzu+//7t7HVN8lUUuc+45wA71n9qaN4iFWV4tVl8JPxOMpTbz2f7Ava8YSfg4vmLl83F2cWP8d8+774P7JifaJRU6c8qrvhz4zUo9fTirKwK7GDvHOBOy2vS8/rVj89nZ9u3z77/vrO3+/O/U/Zuo+zfUcvnX6LKpxdn/1m/uTiMKOsae46NVexi1fDItv1zLU1Ks5V0MfVT7c00hnBYgga6RZkioifqji/lptjYY0Hg8cVfXdeZAPIep2jBFQaP3th9ha1Eiym9H+EQAp5WCUtcoJHoHNxyUv0t0VNh0J2olk0BTpq0ml9WYhn/Ck5BPVxt9WAc4jS+CFRq6llRAErr2W6ry9FOtuH3rZHbhy9FGRU8rdHlCC7QEtV4tRHJ+ScM3lZ5Esw6XlCaJutYcwLC+ABxGphiCkVmiZLMeDWpozkN9qbC4zlNTy93W5CNBpw6/QNrfZY8arRoHJCK/UpIGkdxFXIHD6RHfc3nBtVAZdnT6kRwoswMrNIixhbXQslJMePEafKSV5QUZ6J/x+tofSdFbaM9xAd2UGDyYfuVSJjw+rY4ni33dZdFGeealYmDhf9Ta/bB/s63G6O2oHVyH/yB37P0JADrfmqmMO2es+BCvFBTcb5km+XP81OAtWPWyUCFBYi2RFChTAk3OSiFIXhRVgqnjE7RMt6T5ehzJwXGL9sUpRoKElMVi4aH+vM/m/16nrx+s82vP7YWN9/v5fB3qgYQvR3/yqObQxGb/ml5+1XpWONvP3XSDsf1thM+OZ9YCOVcw3p08MfkQoBDdFPpEDS6i5I1Xkz+7DVcn2xPquQKQ8BpfOKOekgfVrdZ3d7i8OThHre1IcoCP/ISzQe0CgRqNPvl26Eta8zn8bc8i63lUkcVjrU9yP0dSklDDfpeVECFhQNbkpE0MIs+RAfS6Hmxwa1f15QUEbbyJZoi3iipy46qDNcG6ySN6yKJK8vGgaFUZF2yQs8a22ogO+zHgl8qIJVk4ojzoDXnNDgy6gWiqGBFPklhdZt5WwVDy7VhXZWi0MiwSl6kIm3BCYKBmXU/1PIKHBpeJi4TfQAJPNjGPUSyaiwsyQcwGfssiNGPSfwtSeoxsEpc3trDGvI5mKEB3wFOV6ECtaiMzEBSaCEnp0CApZB+IiMmjL24ERVXP1Cj92iKoeToZyNYkymuQKnusfT88O7YpG2nfBvv7ebz3q36lZYtH22pcxHJe+wbgT8Z2Y/byJ+DkfOvRHQvki//A5h5bsOPLQAA","edge":{"manageability":{"edge_last_active_time":"13422825356271814"},"retrigger_features":[],"tab_stabs":{"closed_without_unfreeze_never_unfrozen":0,"closed_without_unfreeze_previously_unfrozen":0,"discard_without_unfreeze_never_unfrozen":0,"discard_without_unfreeze_previously_unfrozen":0},"tab_stats":{"frozen_daily":0,"unfrozen_daily":0}},"edge_ci":{"num_healthy_browsers_since_failure":1},"hardware_acceleration_mode_previous":true,"identity_combined_status":{"aad":1,"ad":1},"legacy":{"profile":{"name":{"migrated":true}}},"local":{"password_hash_data_list":[]},"network_time":{"network_time_mapping":{"local":1.778351691672761e+12,"network":1.778351696e+12,"ticks":83414382894.0,"uncertainty":1351813.0}},"optimization_guide":{"model_execution":{"last_usage_by_feature":{}},"model_store_metadata":{},"on_device":{"last_version":"147.0.3912.98","model_crash_count":0}},"os_crypt":{"audit_enabled":true,"encrypted_key":"RFBBUEkBAAAA0Iyd3wEV0RGMegDAT8KX6wEAAACiPxEnG1/CSY1jnLc4XUkbEAAAAB4AAABNAGkAYwByAG8AcwBvAGYAdAAgAEUAZABnAGUAAAAQZgAAAAEAACAAAAA5m+RU369qlDRNJw536rgYo0g7lbaG+8+1UYQKgVe5UwAAAAAOgAAAAAIAACAAAACdbioUEYXU0KmGVxkd+xO2PXzKDPnf35QIuaeuTDcNSjAAAAANUwQ1tAvl+bBa1dzjsYMVbdkI+ZGjD+J775LQjaGPbvJrVu+gH3jebbxz/FxLsl9AAAAAASWIjwzqxz0hwJWQhbROUd+FJv0v6KT2yDPhU5+s5kl2GMzbnJrtQFGQVlo7h8M6D6TLD0LO4nAWEO1sQzurdQ=="},"performance_intervention":{"last_daily_sample":"13422825290280494"},"phoenix":{"user_laf_toggle_state_static":2},"policy":{"last_statistics_update":"13422825290224528"},"profile":{"info_cache":{"Default":{"active_time":1778351749.85963,"avatar_icon":"chrome://theme/IDR_PROFILE_AVATAR_20","background_apps":false,"edge_account_cid":"","edge_account_environment":0,"edge_account_environment_string":"","edge_account_first_name":"","edge_account_last_name":"","edge_account_oid":"","edge_account_sovereignty":0,"edge_account_tenant_id":"","edge_account_type":0,"edge_create_profile_shortcut":false,"edge_profile_can_be_deleted":true,"edge_profile_can_be_edited":true,"edge_test_on_premises":false,"edge_wam_aad_for_app_account_type":0,"force_signin_profile_locked":false,"gaia_id":"","is_consented_primary_account":false,"is_ephemeral":false,"is_using_default_avatar":true,"is_using_default_name":true,"managed_user_id":"","metrics_bucket_index":1,"name":"Profile 1","signin.with_credential_provider":false,"user_name":""}},"last_active_profiles":["Default"],"metrics":{"next_bucket_index":2},"profile_counts_reported":"13422825290222694","profiles_order":["Default"]},"profile_network_context_service":{"http_cache_finch_experiment_groups":"None None None None"},"profiles":{"edge":{"guided_switch_pref":[],"multiple_profiles_with_same_account":false},"edge_sso_info":{"msa_first_profile_key":"Default","msa_sso_algo_state":1},"signin_last_seen_version":"147.0.3912.98","signin_last_updated_time":1778351690.277739},"sentinel_creation_time":"0","session_id_generator_last_value":"339850127","signin":{"active_accounts_last_emitted":"13422825290183908"},"startup_boost":{"last_browser_open_time":"13422833076692922"},"subresource_filter":{"ruleset_version":{"checksum":860988201,"content":"10.34.0.84","format":37}},"tab_stats":{"discards_expired":0,"discards_external":0,"discards_proactive":0,"discards_urgent":0,"last_daily_sample":"13422825290211560","max_tabs_per_window":1,"reloads_expired":0,"reloads_external":0,"reloads_urgent":0,"total_tab_count_max":2,"window_count_max":2},"telemetry_client":{"cloned_install":{"user_data_dir_id":11297294},"governance":{"last_dma_change_date":"13422825290206518","last_known_cps":0},"host_telclient_path":"QzpcUHJvZ3JhbSBGaWxlcyAoeDg2KVxNaWNyb3NvZnRcRWRnZVdlYlZpZXdcQXBwbGljYXRpb25cMTQ3LjAuMzkxMi45OFx0ZWxjbGllbnQuZGxs","sample_id":28518521},"uninstall_metrics":{"installation_date2":"1778351690"},"updateclientdata":{"apps":{"alpjnmnfbgfkmmpcfpejmmoebdndedno":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"46.0.0.0"},"eeobbhfgfagbclfofmgbdfoicabjdbkn":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"1.0.0.10"},"fgbafbciocncjfbbonhocjaohoknlaco":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"2026.3.23.1"},"jbfaflocpnkhbgcijpkiafdpbjkedane":{"cohort":"","cohortname":"","installdate":-1},"kpfehajjjbbcifeehjgfgnabifknmdad":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"120.0.6050.0"},"laoigpblnllgcgjnjnllmfolckpjlhki":{"cohort":"","cohortname":"","installdate":-1},"ndikpojcjlepofdkaaldkinkjbeeebkl":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"10.34.0.84"},"oankkpibpaokgecfckkdkgaoafllipag":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"6498.2025.9.4"},"ohckeflnhegojcjlcpbfpciadgikcohk":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"0.0.1.7"},"ojblfafjmiikbkepnnolpgbbhejhlcim":{"cohort":"","cohortname":"","installdate":-1}}},"updateclientlastupdatecheckerror":0,"updateclientlastupdatecheckerrorcategory":0,"updateclientlastupdatecheckerrorextracode1":0,"user_experience_metrics":{"chrome_download_action_count":0,"client_id2":"{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}C:\\Users\\eslusarz0s:05D2D359-2B14-4013-B5BA-6ED5F41F2761","diagnostics":{"last_data_collection_level_on_launch":1},"limited_entropy_randomization_source":"94FB2CB93E02CD91F8FEEE6A7854498F","low_entropy_source3":4436,"machine_id":492731,"payload_counter":1,"pseudo_low_entropy_source":452,"reporting_enabled":false,"reset_client_id_deterministic":true,"session_id":0,"stability":{"browser_last_live_timestamp":"13422832490277286","stats_buildtime":"1777534620","stats_version":"147.0.3912.98-64","system_crash_count":0}},"variations_compressed_seed":"H4sIAAAAAAAAAJVVbXPiNhD+Kxl9tlLL79DpB8JLjh7c0QCXdnqZjLDXjiayRCUZwmT47x1ZhIT0mFz5wHh3n93n2dVafkbD/hx1n1GfMxCmL0XJqkZRw6RYrgtqYLgBYSxiANzQiayGgq44FKhbUq7BQ6OG8zmY85GRgn8aEPkOdYnv7z00fMp5U8DwyYASlDvScaHHYiIr1DWqAQ8570RWC6oqMKiLoKjgXhvLgWyVogIHatUxbQMTmVP+BcxWqsdenoPW/QfIHy2icIgRUNMo0Kj7NzqD1uhu76HtJphTUazk05nssZacGjiAoBiXitbgkg9yRozDfKcN1G/Kc6bNmZLv8QOmIDdS7cYG3KFccekquL4slxv77begVxTMYiifKWnTPzPOoVgAhxqM2llSEO85a30Lq28Mth/nW7Z5kT84xnPl7MFYVAv/YznuW+Ca2uEYUBb0jAStAXVR/kCFAI48tKG8sZ4R2nvHMKxl/vAmGPru9xajwCgqdM1Muxn3UtxvmYJ7w2qQjbmvGedMQy5Fod+UCmwVK/DrBpRiBSw/T/W5jpaP9bXc2GUVOUzs8d15ZzpqwS81W+gr55TlSmpZmssRU9rMqDK7w/bd2FdEmxvQDTce8Uj866m89jU8K9BFe5zL7UfyWuiHAm9hdaXkVoO6nClp5KopL5efp5duOWdKloyD51udP5FkqNGXE1nNDVXG873o/yT1Zb3mYKDNc0M5buRMrufUhtt/JqpzAxpJlcMx7Yj2UK3tFQPaLAUrpaoHTBvFVo19Dz4xbWSlaH1+npWSzTo6yngzS3K6pi0w/glgASVtuLm2+LPwu/3hAmwX6aYRrxfhsF6b3Y9D/x0MQKly1FabQ1WDMO0lY8EjJYVhoHpNwUDklvqLFFbJtDfucY66qL3mkYdub4enDp2vy8Z6/Pa5aqgqXowNqPZxGiZxXyo4zexLYUCYOagNy0G/44HVn4tT1xUT1anHtn7qOe7aUlvug3/voU9Ai/Y8n9FwQSvURd8R/PJ1MMtnoXnQo3U4Hq9JXk5mtfx9ES2X5SYjV+VqOdwkf12Pf/uOLN/TmrXTRHNqvAu/czGlu4vAD5IL0umGUTeOL66ni7a3Rhi168vCDnNsXXbJG33wtFfSy4dvPHC67NcZzfANJmlM4sTHBBOvtf0siNPWto4BjoIwy3CAE3T6bTxkh0kcERzj2GWHJI4yggnOnB1HhKQEJ7hzsIMs8H0c4sjZhIRxSHB0iCdZlEa4g0ngTBL4CQ4iHITO9hOS4gwHTmsUh2mIiY+zFP14b51IP42zJMYRztD7hTx0QZKUtJWI73RFaeiT5LUPEnc6WYzJS5+EhB0S4yB2Y7IknSwMI0xw4qQmfpphgsOjlR6zEz/LAkywazIK/SzA4SEWBWlkqwRov/8X5nU8zUYJAAA=","variations_crash_streak":0,"variations_failed_to_fetch_seed_streak":0,"variations_google_groups":{"Default":[]},"variations_last_fetch_time":"13422825293001203","variations_last_runtime_fetch_time":"13422825293006739","variations_runtime_compressed_seed":"H4sIAAAAAAAAAG2Py07DMBBF/2W2ZFQ/Jo4diQ1pIGFVqq6gLEJjTBF1mpdEqPLvqLW66/Lcc6U7c4Ks8Z97Vy57SGGFa+TMSEExchQUhUArRshRJhdOtGQKOXIdUCpxwWCV5CpGQqEuGEtBEgUGSYwZifIqpU6IUKMJVnJtDAqDZEy0wiVyHmvFCQVeL5E6UQwFcgYR5LWz69EP+4MNT0B6gvxwHKabxvrq48c+2moYO9tD+gbWdjt4n+cIClvVtuvPtawZ/dBNWVNbSKHcnIc2lYMUtvASP7PClbtGqwffHkXjstxNrL/7Jfpqiz/vn8R3vXhdtO5+CzDP/+zFLFRfAQAA","variations_runtime_config_ids":"P-R-1093245-1-24,P-R-108604-1-37,P-R-78306-1-18,P-R-73626-1-17,P-R-63165-4-26,P-R-53243-2-7,P-R-40093-3-26,P-R-38744-8-97,P-R-31899-29-499,P-D-1158614-2-4,P-R-1038760-2-10","variations_seed_client_version_at_store":"147.0.3912.98","variations_seed_date":"13422825296000000","variations_seed_milestone":147,"variations_seed_runtime_etag":"\"Q5J0HgIco86Bnqp2ogCEgy0s+x44hqHznnG2jd/Z/qg=\"","variations_seed_runtime_serial_number":"\"Q5J0HgIco86Bnqp2ogCEgy0s+x44hqHznnG2jd/Z/qg=\"","variations_seed_serial_number":"\"e/ODPcP3thsFp3IIp1cfLPmoJT4UUfv81BfbUEv6YGI=\"","variations_seed_signature":"","was":{"restarted":false}} \ No newline at end of file +{"accessibility":{"captions":{"common_models_path":"","soda_translation_binary_path":""}},"autofill":{"ablation_seed":"FivBD7Ft8QE="},"breadcrumbs":{"enabled":true,"enabled_time":"13422825290225753"},"default_browser":{"browser_name_enum":6},"desktop_session_duration_tracker":{"last_session_end_timestamp":"1778351759"},"domain_actions_config":"H4sIAAAAAAAAAL1abW8bNxL+K4ZwH5LCWitJm975EASFkUMKNGiQS9ED6p4wS452JyI5NMnV7rrJfz9QL7Y2Wq2XcnAfLEujeWbI4exwXvTXREg95xU6RxInl39NwFpFAgKx8ZPLP7YElHPLikQ7uZz8alT7prHs8b2C9gOCbCfnE8kayEwuJ2Wlqkywnnw5TwfrypPIIgpPlhFWWctVqPLTRXhFptig/zyfrFGEG3MY0HhUQGht/DKS3JoUlR8gfieJKzJ4D7ijRHUrdJ7YTC6ffTmfCJYoEg/oLUl8t3iLK3EV0V/Z5gHjDoANmYBG8qBhDvHbPe4Te7apo2XmZBQZTHVIG36twv5KwdqscKA1ONUOeMEB0Jfg0DKZcBpqKhcpQMNxW5nnsQBFqyGvPuDnxYLECYgXL384GZRpAT7TfjTYoHSn7ctgGIsQiiuZaRKOPS9Gw9YGT1ATELS/V3Oi71WjjSdYazbR39kVY0E15lldQvARl7BCwZYUJ20KJA/G4UOAExnQ6BWBWUHSFsCKKmkHogQHIqBLWVYJobBpahRUElN0cIkuybQS0QKlOEpEqFQVHnGZaUyGpKghSNsIKlyhUZD7jEYHWw1uKdi2CYeiMSS5o67cIkV8a8h8ggSE+btJ2DGHND+36KzChkKKjSwnea116NGETQKQosaR1ymmuqlIqTwtvN3UaBJUONS8wiwf7beuMjW0OukZ9JXhhDX51oQSPUGCnwRsgmAXsElZWO0oulcCouWhUuKA/RYspSnY3WgnXdiBloGT4lZ+V1aM4y+Yi8FK6ABRWT9ct2wQPQl4zO3DfEEqoJuzmfNiMfc1BVGOy8KvNhL+tRbQCVpd2x5ZWBd+sD4UNrEqeK+AzEdswm8ffvGx+OoUqWAKroLPHrLwoJR4zT9OglcgBjxoELsAgTkPOeAgvMb18k8FU0PmRPDNzcla86GIM4xlJ+NV4k/Eh5rCYPQaREvygp0cfAL6BGxr5zdX7yNhzRG2HIfPCEmV+IxsOxgOF9SgfPPuTSd1wLBQNGDvMWgfKkk8YPRBIdt2kIZbjs6WfbLfQEi1fLyQR29GHsmPx0vAIzXieAkL91gJZB4t4UhlnXAY8A2OM8tPscVemzAZyxYNScHGoAixIIfbymGNuaeAftNyOBIo+uTuOo87ou7pJZKGAucaCkOLdu6wwCYxXiiu0XfaI5GQfde/f8yhJV106rAN6RhCOKDCK/LdJO2OegwX9G0nVuvbo5zgCuxmcWvKMf4897H06PRBd7RjGEsmOOzugTJLJu78qLdEhwiQK+wWDJ5u0WUctiqPwoFcbvKvfFyAKAdSE40GnOwcqJAm25DF4GW184QVqCp+vr5+HVf66omWnxv19GzzqWnUfgv83iF2MD9VT66v5XdPz/xUPXs5m+2zd7xhh5i/mM2aF7PZ9XV2Nn/2fDZr/jGbZfuwjTPc8Wu5Zm1Ul2nnBzu+//7t7HVN8lUUuc+45wA71n9qaN4iFWV4tVl8JPxOMpTbz2f7Ava8YSfg4vmLl83F2cWP8d8+774P7JifaJRU6c8qrvhz4zUo9fTirKwK7GDvHOBOy2vS8/rVj89nZ9u3z77/vrO3+/O/U/Zuo+zfUcvnX6LKpxdn/1m/uTiMKOsae46NVexi1fDItv1zLU1Ks5V0MfVT7c00hnBYgga6RZkioifqji/lptjYY0Hg8cVfXdeZAPIep2jBFQaP3th9ha1Eiym9H+EQAp5WCUtcoJHoHNxyUv0t0VNh0J2olk0BTpq0ml9WYhn/Ck5BPVxt9WAc4jS+CFRq6llRAErr2W6ry9FOtuH3rZHbhy9FGRU8rdHlCC7QEtV4tRHJ+ScM3lZ5Esw6XlCaJutYcwLC+ABxGphiCkVmiZLMeDWpozkN9qbC4zlNTy93W5CNBpw6/QNrfZY8arRoHJCK/UpIGkdxFXIHD6RHfc3nBtVAZdnT6kRwoswMrNIixhbXQslJMePEafKSV5QUZ6J/x+tofSdFbaM9xAd2UGDyYfuVSJjw+rY4ni33dZdFGeealYmDhf9Ta/bB/s63G6O2oHVyH/yB37P0JADrfmqmMO2es+BCvFBTcb5km+XP81OAtWPWyUCFBYi2RFChTAk3OSiFIXhRVgqnjE7RMt6T5ehzJwXGL9sUpRoKElMVi4aH+vM/m/16nrx+s82vP7YWN9/v5fB3qgYQvR3/yqObQxGb/ml5+1XpWONvP3XSDsf1thM+OZ9YCOVcw3p08MfkQoBDdFPpEDS6i5I1Xkz+7DVcn2xPquQKQ8BpfOKOekgfVrdZ3d7i8OThHre1IcoCP/ISzQe0CgRqNPvl26Eta8zn8bc8i63lUkcVjrU9yP0dSklDDfpeVECFhQNbkpE0MIs+RAfS6Hmxwa1f15QUEbbyJZoi3iipy46qDNcG6ySN6yKJK8vGgaFUZF2yQs8a22ogO+zHgl8qIJVk4ojzoDXnNDgy6gWiqGBFPklhdZt5WwVDy7VhXZWi0MiwSl6kIm3BCYKBmXU/1PIKHBpeJi4TfQAJPNjGPUSyaiwsyQcwGfssiNGPSfwtSeoxsEpc3trDGvI5mKEB3wFOV6ECtaiMzEBSaCEnp0CApZB+IiMmjL24ERVXP1Cj92iKoeToZyNYkymuQKnusfT88O7YpG2nfBvv7ebz3q36lZYtH22pcxHJe+wbgT8Z2Y/byJ+DkfOvRHQvki//A5h5bsOPLQAA","edge":{"manageability":{"edge_last_active_time":"13422825356271814"},"retrigger_features":[],"tab_stabs":{"closed_without_unfreeze_never_unfrozen":0,"closed_without_unfreeze_previously_unfrozen":0,"discard_without_unfreeze_never_unfrozen":0,"discard_without_unfreeze_previously_unfrozen":0},"tab_stats":{"frozen_daily":0,"unfrozen_daily":0}},"edge_ci":{"num_healthy_browsers_since_failure":2},"hardware_acceleration_mode_previous":true,"identity_combined_status":{"aad":1,"ad":1},"legacy":{"profile":{"name":{"migrated":true}}},"local":{"password_hash_data_list":[]},"optimization_guide":{"model_execution":{"last_usage_by_feature":{}},"model_store_metadata":{},"on_device":{"last_version":"147.0.3912.98","model_crash_count":0}},"os_crypt":{"audit_enabled":true,"encrypted_key":"RFBBUEkBAAAA0Iyd3wEV0RGMegDAT8KX6wEAAACiPxEnG1/CSY1jnLc4XUkbEAAAAB4AAABNAGkAYwByAG8AcwBvAGYAdAAgAEUAZABnAGUAAAAQZgAAAAEAACAAAAA5m+RU369qlDRNJw536rgYo0g7lbaG+8+1UYQKgVe5UwAAAAAOgAAAAAIAACAAAACdbioUEYXU0KmGVxkd+xO2PXzKDPnf35QIuaeuTDcNSjAAAAANUwQ1tAvl+bBa1dzjsYMVbdkI+ZGjD+J775LQjaGPbvJrVu+gH3jebbxz/FxLsl9AAAAAASWIjwzqxz0hwJWQhbROUd+FJv0v6KT2yDPhU5+s5kl2GMzbnJrtQFGQVlo7h8M6D6TLD0LO4nAWEO1sQzurdQ=="},"performance_intervention":{"last_daily_sample":"13422825290280494"},"phoenix":{"user_laf_toggle_state_static":2},"policy":{"last_statistics_update":"13422825290224528"},"profile":{"info_cache":{"Default":{"active_time":1778351749.85963,"avatar_icon":"chrome://theme/IDR_PROFILE_AVATAR_20","background_apps":false,"edge_account_cid":"","edge_account_environment":0,"edge_account_environment_string":"","edge_account_first_name":"","edge_account_last_name":"","edge_account_oid":"","edge_account_sovereignty":0,"edge_account_tenant_id":"","edge_account_type":0,"edge_create_profile_shortcut":false,"edge_non_signin_profile_type":1,"edge_profile_can_be_deleted":true,"edge_profile_can_be_edited":true,"edge_test_on_premises":false,"edge_wam_aad_for_app_account_type":0,"enterprise_label":"","force_signin_profile_locked":false,"gaia_given_name":"","gaia_id":"","gaia_name":"","hosted_domain":"","is_consented_primary_account":false,"is_ephemeral":false,"is_glic_eligible":false,"is_managed":0,"is_using_default_avatar":true,"is_using_default_name":true,"managed_user_id":"","metrics_bucket_index":1,"name":"Profile 1","signin.with_credential_provider":false,"user_name":""}},"last_active_profiles":["Default"],"metrics":{"next_bucket_index":2},"profile_counts_reported":"13422825290222694","profiles_order":["Default"]},"profile_network_context_service":{"http_cache_finch_experiment_groups":"None None None None"},"profiles":{"edge":{"guided_switch_pref":[],"multiple_profiles_with_same_account":false},"edge_sso_info":{"msa_first_profile_key":"Default","msa_sso_algo_state":1},"signin_last_seen_version":"147.0.3912.98","signin_last_updated_time":1778351690.277739},"sentinel_creation_time":"0","session_id_generator_last_value":"339850194","signin":{"active_accounts_last_emitted":"13422825290183908"},"startup_boost":{"last_browser_open_time":"13422848006138729"},"subresource_filter":{"ruleset_version":{"checksum":860988201,"content":"10.34.0.84","format":37}},"tab_stats":{"discards_expired":0,"discards_external":0,"discards_proactive":0,"discards_urgent":0,"last_daily_sample":"13422825290211560","max_tabs_per_window":1,"reloads_expired":0,"reloads_external":0,"reloads_urgent":0,"total_tab_count_max":4,"window_count_max":4},"telemetry_client":{"cloned_install":{"user_data_dir_id":11297294},"governance":{"last_dma_change_date":"13422825290206518","last_known_cps":0},"host_telclient_path":"QzpcUHJvZ3JhbSBGaWxlcyAoeDg2KVxNaWNyb3NvZnRcRWRnZVdlYlZpZXdcQXBwbGljYXRpb25cMTQ3LjAuMzkxMi45OFx0ZWxjbGllbnQuZGxs","sample_id":28518521},"uninstall_metrics":{"installation_date2":"1778351690"},"updateclientdata":{"apps":{"alpjnmnfbgfkmmpcfpejmmoebdndedno":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"46.0.0.0"},"eeobbhfgfagbclfofmgbdfoicabjdbkn":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"1.0.0.10"},"fgbafbciocncjfbbonhocjaohoknlaco":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"2026.3.23.1"},"jbfaflocpnkhbgcijpkiafdpbjkedane":{"cohort":"","cohortname":"","installdate":-1},"kpfehajjjbbcifeehjgfgnabifknmdad":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"120.0.6050.0"},"laoigpblnllgcgjnjnllmfolckpjlhki":{"cohort":"","cohortname":"","installdate":-1},"ndikpojcjlepofdkaaldkinkjbeeebkl":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"10.34.0.84"},"oankkpibpaokgecfckkdkgaoafllipag":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"6498.2025.9.4"},"ohckeflnhegojcjlcpbfpciadgikcohk":{"cohort":"","cohortname":"","fp":"","installdate":-1,"max_pv":"0.0.0.0","pv":"0.0.1.7"},"ojblfafjmiikbkepnnolpgbbhejhlcim":{"cohort":"","cohortname":"","installdate":-1}}},"updateclientlastupdatecheckerror":0,"updateclientlastupdatecheckerrorcategory":0,"updateclientlastupdatecheckerrorextracode1":0,"user_experience_metrics":{"chrome_download_action_count":0,"client_id2":"{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}C:\\Users\\eslusarz0s:05D2D359-2B14-4013-B5BA-6ED5F41F2761","diagnostics":{"last_data_collection_level_on_launch":1},"limited_entropy_randomization_source":"94FB2CB93E02CD91F8FEEE6A7854498F","low_entropy_source3":4436,"machine_id":492731,"payload_counter":1,"pseudo_low_entropy_source":452,"reporting_enabled":false,"reset_client_id_deterministic":true,"session_id":1,"stability":{"browser_last_live_timestamp":"13422847640804626","stats_buildtime":"1777534620","stats_version":"147.0.3912.98-64","system_crash_count":0}},"variations_compressed_seed":"H4sIAAAAAAAAAJVVbXPiNhD+Kxl9tlLL79DpB8JLjh7c0QCXdnqZjLDXjiayRCUZwmT47x1ZhIT0mFz5wHh3n93n2dVafkbD/hx1n1GfMxCmL0XJqkZRw6RYrgtqYLgBYSxiANzQiayGgq44FKhbUq7BQ6OG8zmY85GRgn8aEPkOdYnv7z00fMp5U8DwyYASlDvScaHHYiIr1DWqAQ8570RWC6oqMKiLoKjgXhvLgWyVogIHatUxbQMTmVP+BcxWqsdenoPW/QfIHy2icIgRUNMo0Kj7NzqD1uhu76HtJphTUazk05nssZacGjiAoBiXitbgkg9yRozDfKcN1G/Kc6bNmZLv8QOmIDdS7cYG3KFccekquL4slxv77begVxTMYiifKWnTPzPOoVgAhxqM2llSEO85a30Lq28Mth/nW7Z5kT84xnPl7MFYVAv/YznuW+Ca2uEYUBb0jAStAXVR/kCFAI48tKG8sZ4R2nvHMKxl/vAmGPru9xajwCgqdM1Muxn3UtxvmYJ7w2qQjbmvGedMQy5Fod+UCmwVK/DrBpRiBSw/T/W5jpaP9bXc2GUVOUzs8d15ZzpqwS81W+gr55TlSmpZmssRU9rMqDK7w/bd2FdEmxvQDTce8Uj866m89jU8K9BFe5zL7UfyWuiHAm9hdaXkVoO6nClp5KopL5efp5duOWdKloyD51udP5FkqNGXE1nNDVXG873o/yT1Zb3mYKDNc0M5buRMrufUhtt/JqpzAxpJlcMx7Yj2UK3tFQPaLAUrpaoHTBvFVo19Dz4xbWSlaH1+npWSzTo6yngzS3K6pi0w/glgASVtuLm2+LPwu/3hAmwX6aYRrxfhsF6b3Y9D/x0MQKly1FabQ1WDMO0lY8EjJYVhoHpNwUDklvqLFFbJtDfucY66qL3mkYdub4enDp2vy8Z6/Pa5aqgqXowNqPZxGiZxXyo4zexLYUCYOagNy0G/44HVn4tT1xUT1anHtn7qOe7aUlvug3/voU9Ai/Y8n9FwQSvURd8R/PJ1MMtnoXnQo3U4Hq9JXk5mtfx9ES2X5SYjV+VqOdwkf12Pf/uOLN/TmrXTRHNqvAu/czGlu4vAD5IL0umGUTeOL66ni7a3Rhi168vCDnNsXXbJG33wtFfSy4dvPHC67NcZzfANJmlM4sTHBBOvtf0siNPWto4BjoIwy3CAE3T6bTxkh0kcERzj2GWHJI4yggnOnB1HhKQEJ7hzsIMs8H0c4sjZhIRxSHB0iCdZlEa4g0ngTBL4CQ4iHITO9hOS4gwHTmsUh2mIiY+zFP14b51IP42zJMYRztD7hTx0QZKUtJWI73RFaeiT5LUPEnc6WYzJS5+EhB0S4yB2Y7IknSwMI0xw4qQmfpphgsOjlR6zEz/LAkywazIK/SzA4SEWBWlkqwRov/8X5nU8zUYJAAA=","variations_config_ids":"P-R-1736541-5-5,P-R-1315481-1-8,P-R-1541171-6-9,P-R-1528200-3-4,P-R-1113531-4-9,P-R-68474-9-12,P-R-61206-24-23,P-R-60617-8-21,P-R-45373-10-87,P-R-1075865-4-8","variations_crash_streak":1,"variations_failed_to_fetch_seed_streak":0,"variations_google_groups":{"Default":[]},"variations_last_fetch_time":"13422825293001203","variations_last_runtime_fetch_time":"13422825293006739","variations_runtime_compressed_seed":"H4sIAAAAAAAAAG2Py07DMBBF/2W2ZFQ/Jo4diQ1pIGFVqq6gLEJjTBF1mpdEqPLvqLW66/Lcc6U7c4Ks8Z97Vy57SGGFa+TMSEExchQUhUArRshRJhdOtGQKOXIdUCpxwWCV5CpGQqEuGEtBEgUGSYwZifIqpU6IUKMJVnJtDAqDZEy0wiVyHmvFCQVeL5E6UQwFcgYR5LWz69EP+4MNT0B6gvxwHKabxvrq48c+2moYO9tD+gbWdjt4n+cIClvVtuvPtawZ/dBNWVNbSKHcnIc2lYMUtvASP7PClbtGqwffHkXjstxNrL/7Jfpqiz/vn8R3vXhdtO5+CzDP/+zFLFRfAQAA","variations_runtime_config_ids":"P-R-1093245-1-24,P-R-108604-1-37,P-R-78306-1-18,P-R-73626-1-17,P-R-63165-4-26,P-R-53243-2-7,P-R-40093-3-26,P-R-38744-8-97,P-R-31899-29-499,P-D-1158614-2-4,P-R-1038760-2-10","variations_seed_client_version_at_store":"147.0.3912.98","variations_seed_date":"13422825296000000","variations_seed_etag":"\"e/ODPcP3thsFp3IIp1cfLPmoJT4UUfv81BfbUEv6YGI=\"","variations_seed_milestone":147,"variations_seed_runtime_etag":"\"Q5J0HgIco86Bnqp2ogCEgy0s+x44hqHznnG2jd/Z/qg=\"","variations_seed_runtime_serial_number":"\"Q5J0HgIco86Bnqp2ogCEgy0s+x44hqHznnG2jd/Z/qg=\"","variations_seed_serial_number":"\"e/ODPcP3thsFp3IIp1cfLPmoJT4UUfv81BfbUEv6YGI=\"","variations_seed_signature":"","was":{"restarted":false}} \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/SmartScreen/local/uriCache_ b/.metadata/.plugins/org.eclipse.swt/EBWebView/SmartScreen/local/uriCache_ index c31356f..3cfdb1c 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/SmartScreen/local/uriCache_ +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/SmartScreen/local/uriCache_ @@ -1 +1 @@ -{"version":1,"cache_data":[]} \ No newline at end of file +{"version":1,"cache_data":[{"file_hash":"145d0023f037c9bf","server_context":"1;f94c025f-7523-6972-b613-ce2c246c55ce;unkn:100;0.01","result":1,"response_category":"Allowed","expiration_time":1778470341295392},{"file_hash":"f4df362a8544bc8c","server_context":"1;f94c025f-7523-6972-b613-ce2c246c55ce;unkn:100;0.01","result":1,"response_category":"Allowed","expiration_time":1778470341295392}]} \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/Variations b/.metadata/.plugins/org.eclipse.swt/EBWebView/Variations index a157215..5d75f57 100644 --- a/.metadata/.plugins/org.eclipse.swt/EBWebView/Variations +++ b/.metadata/.plugins/org.eclipse.swt/EBWebView/Variations @@ -1 +1 @@ -{"user_experience_metrics.stability.exited_cleanly":false,"variations_crash_streak":0} \ No newline at end of file +{"user_experience_metrics.stability.exited_cleanly":false,"variations_crash_streak":1} \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.swt/EBWebView/lockfile b/.metadata/.plugins/org.eclipse.swt/EBWebView/lockfile new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.terminal.view.ui/.executables/data.properties b/.metadata/.plugins/org.eclipse.terminal.view.ui/.executables/data.properties new file mode 100644 index 0000000..ac452bc --- /dev/null +++ b/.metadata/.plugins/org.eclipse.terminal.view.ui/.executables/data.properties @@ -0,0 +1,5 @@ +#Sun May 10 01:33:34 CEST 2026 +0.Args=--login -i +0.Name=Git Bash +0.Path=C\:\\Program Files\\Git\\bin\\sh.exe +0.Translate=true diff --git a/.metadata/version.ini b/.metadata/version.ini index c5b36b8..58fd960 100644 --- a/.metadata/version.ini +++ b/.metadata/version.ini @@ -1,3 +1,3 @@ -#Sat May 09 20:34:12 CEST 2026 +#Sun May 10 01:31:23 CEST 2026 org.eclipse.core.runtime=2 org.eclipse.platform=4.39.0.v20260226-0420 diff --git a/asdl/bin/comparatori/videogioco/Videogioco.class b/asdl/bin/comparatori/videogioco/Videogioco.class index f7200ad..68023b0 100644 Binary files a/asdl/bin/comparatori/videogioco/Videogioco.class and b/asdl/bin/comparatori/videogioco/Videogioco.class differ diff --git a/asdl/bin/jcf_set/exercise/EsercizioParole$1.class b/asdl/bin/jcf_set/exercise/EsercizioParole$1.class new file mode 100644 index 0000000..fb6276c Binary files /dev/null and b/asdl/bin/jcf_set/exercise/EsercizioParole$1.class differ diff --git a/asdl/bin/jcf_set/exercise/EsercizioParole.class b/asdl/bin/jcf_set/exercise/EsercizioParole.class new file mode 100644 index 0000000..9f563ce Binary files /dev/null and b/asdl/bin/jcf_set/exercise/EsercizioParole.class differ diff --git a/asdl/bin/jcf_set/exercise/Insiemistica.class b/asdl/bin/jcf_set/exercise/Insiemistica.class new file mode 100644 index 0000000..74c01fc Binary files /dev/null and b/asdl/bin/jcf_set/exercise/Insiemistica.class differ diff --git a/asdl/bin/jcf_set/exercise/IteratoreSenzaDuplicati.class b/asdl/bin/jcf_set/exercise/IteratoreSenzaDuplicati.class new file mode 100644 index 0000000..4000612 Binary files /dev/null and b/asdl/bin/jcf_set/exercise/IteratoreSenzaDuplicati.class differ diff --git a/asdl/src/comparatori/videogioco/Videogioco.java b/asdl/src/comparatori/videogioco/Videogioco.java index 0e07468..1fc9b0c 100644 --- a/asdl/src/comparatori/videogioco/Videogioco.java +++ b/asdl/src/comparatori/videogioco/Videogioco.java @@ -10,9 +10,6 @@ public class Videogioco implements Comparable{ private Integer voto; // Costruttore - - private Videogioco() {} - public Videogioco( String titolo, String piattaforma, diff --git a/asdl/src/jcf_set/exercise/EsercizioParole.java b/asdl/src/jcf_set/exercise/EsercizioParole.java new file mode 100644 index 0000000..f216e43 --- /dev/null +++ b/asdl/src/jcf_set/exercise/EsercizioParole.java @@ -0,0 +1,46 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class EsercizioParole { + + /* + * EX1 del 27-01-2026 (I Appello) + * Si scriva un metodo + * public List DifferentWordsList(List) + * che, data in input una lista di stringhe, restituisce una + * nuova lista priva di elementi duplicati, contenente tutte le + * stringhe distinte di list e ordinata per lunghezze decrescenti + * (a parità di lunghezza ordinamento lessicografico crescente) + */ + public List DifferentWordsList(List lista) { + Set listaOrd = new TreeSet(new Comparator() { + @Override + public int compare(String s1, String s2) { + int l1 = s1.length(); + int l2 = s2.length(); + + int cmp = Integer.compare(l2, l1); + + if (cmp != 0) return cmp; + + return s1.compareTo(s2); + } + }); + + if (lista == null || lista.isEmpty()) return new ArrayList(listaOrd); + + Iterator it = lista.iterator(); + while (it.hasNext()) { + listaOrd.add(it.next()); + } + + return new ArrayList(listaOrd); + } + +} diff --git a/asdl/src/jcf_set/exercise/Insiemistica.java b/asdl/src/jcf_set/exercise/Insiemistica.java new file mode 100644 index 0000000..349c6b9 --- /dev/null +++ b/asdl/src/jcf_set/exercise/Insiemistica.java @@ -0,0 +1,87 @@ +package jcf_set.exercise; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class Insiemistica { + + public static void main(String[] main) { + + // Insiemi di test + Integer[] aArray = {1, -2, 3, -4, 3}; + Integer[] bArray = {1, 5, -6, -4, 5}; + + // Input come HashSet (Ordine non garantito) + Set aHashSet = new HashSet(Arrays.asList(aArray)); + Set bHashSet = new HashSet(Arrays.asList(bArray)); + + // Stampa delle due collezioni + System.out.println("Stampa della collezone a: "); + System.out.println(aHashSet); + System.out.println("Stampa della collezione b: "); + System.out.println(bHashSet); + + // Unione + System.out.println("Stampa della unione: "); + System.out.println(union(aHashSet, bHashSet)); + + // Intersezione + System.out.println("Stampa della intersezione: "); + System.out.println(intersection(aHashSet, bHashSet)); + + // Difference + System.out.println("Stampa della differenza: "); + System.out.println(difference(aHashSet, bHashSet)); + + // Abs + System.out.println("Stampa della ABS: "); + System.out.println(abs(union(aHashSet, bHashSet))); + + } + + // Operazioni di insiemistica + + /* + * Per eseguire una unione, è conveniente + * adoperare la Set poichè l'implementazione + * TreeSet permette di non mantenere duplicati. + */ + public static > Set union(Set s1, Set s2) { + Set union = new HashSet(); + union.addAll(s1); + union.addAll(s2); + return union; + } + + /* + * Per eseguire una intersezione, è conveniente + * adoperare la Set allo stesso modo + */ + public static > Set intersection(Set s1, Set s2) { + Set intersection = new HashSet(); + intersection.addAll(s1); + intersection.retainAll(s2); + return intersection; + } + + /* + * Per eseguire la differenza, si usa + * la Set + */ + public static > Set difference(Set s1, Set s2) { + Set difference = new HashSet(); + difference.addAll(s1); + difference.removeAll(s2); + return difference; + } + + public static Set abs(Set s) { + Set abs = new HashSet(); + Iterator it = s.iterator(); + while (it.hasNext()) abs.add(Math.abs(it.next())); + return abs; + } + +} diff --git a/asdl/src/jcf_set/exercise/IteratoreSenzaDuplicati.java b/asdl/src/jcf_set/exercise/IteratoreSenzaDuplicati.java new file mode 100644 index 0000000..f084506 --- /dev/null +++ b/asdl/src/jcf_set/exercise/IteratoreSenzaDuplicati.java @@ -0,0 +1,75 @@ +package jcf_set.exercise; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class IteratoreSenzaDuplicati { + + public static void main(String[] main) { + new IteratoreSenzaDuplicati().run(); + } + + public void run() { + + List lista = new ArrayList(); + + lista.add("tree"); + lista.add("flower"); + lista.add("tree"); + lista.add("flower"); + lista.add("animal"); + lista.add("flower"); + lista.add("fruit"); + + // Stampa collections + System.out.println("Lista con duplicati: "); + System.out.println(lista); + System.out.println(); + + // Test metodi privati + List testList = new LinkedList(); + + Iterator itNoDup = getIteratorNoDuplicates(lista.iterator()); + while (itNoDup.hasNext()) testList.add(itNoDup.next()); + + System.out.println("Lista senza duplicati: "); + System.out.println(testList); + System.out.println(); + + testList = new LinkedList(); + System.gc(); + + Iterator itNoDupOrd = getIteratorNoDuplicatesOrdinated(lista.iterator()); + while (itNoDupOrd.hasNext()) testList.add(itNoDupOrd.next()); + + System.out.println("Lista senza duplicati ordinata: "); + System.out.println(testList); + } + + // Esercizio 1 + /* + * Passare una lista con duplicati. + * Ottenere un iteratore privo di duplicati. + */ + private static > Iterator getIteratorNoDuplicates(Iterator it) { + HashSet tmp = new HashSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + + // Esercizio 2 + /* + * Passare come parametro una lista con duplicati. + * Ottenere un iteratore senza duplicati e ordinato. + */ + private static > Iterator getIteratorNoDuplicatesOrdinated(Iterator it) { + TreeSet tmp = new TreeSet(); + while (it.hasNext()) tmp.add(it.next()); + return tmp.iterator(); + } + +}