Commits

Tim Vernum  committed 90076af

Add sample lambdas used in the wiki documentation

  • Participants
  • Parent commits 6972f4a

Comments (0)

Files changed (1)

File convert/source/java/samples/sample/WikiSamples.java

+/* ------------------------------------------------------------------------
+ * Copyright 2013 Tim Vernum
+ * ------------------------------------------------------------------------
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ------------------------------------------------------------------------
+ */
+
+import java.io.FileFilter;
+import java.util.Comparator;
+import java.util.concurrent.Callable;
+
+public class WikiSamples
+{
+
+    public static void main(String[] args)
+    {
+        Runnable runnable = () -> {
+            System.out.println("Running!");
+        };
+        Callable<String> callable = () -> "abc";
+        FileFilter filter = (file) -> file.getName().endsWith(".xml");
+        javax.swing.event.ChangeListener listener = event -> { System.err.println("Event:" + event); };
+        Comparator<? super String> cmp = (CharSequence a, CharSequence b) -> {
+            Integer l1 = a.length(), l2 = b.length();
+            return l1.compareTo(l2);
+        };
+    }
+}