[Mulgara-svn] r1160 - trunk/src/jar/util/java/org/mulgara/util
pag at mulgara.org
pag at mulgara.org
Sat Aug 23 01:51:06 UTC 2008
Author: pag
Date: 2008-08-22 18:51:05 -0700 (Fri, 22 Aug 2008)
New Revision: 1160
Added:
trunk/src/jar/util/java/org/mulgara/util/Fn.java
trunk/src/jar/util/java/org/mulgara/util/FnE.java
Log:
Zero argument functors
Added: trunk/src/jar/util/java/org/mulgara/util/Fn.java
===================================================================
--- trunk/src/jar/util/java/org/mulgara/util/Fn.java (rev 0)
+++ trunk/src/jar/util/java/org/mulgara/util/Fn.java 2008-08-23 01:51:05 UTC (rev 1160)
@@ -0,0 +1,26 @@
+/*
+ * The contents of this file are subject to the Open Software License
+ * Version 3.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.opensource.org/licenses/osl-3.0.txt
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ */
+
+package org.mulgara.util;
+
+/**
+ * Functor template for a function that takes no arguments and returns a value,
+ * without throwing an exception.
+ *
+ * @created Aug 4, 2008
+ * @author Paul Gearon
+ * @copyright © 2008 <a href="http://www.topazproject.org/">The Topaz Project</a>
+ * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
+ */
+public interface Fn<T1> extends FnE<T1,RuntimeException> {
+
+}
Added: trunk/src/jar/util/java/org/mulgara/util/FnE.java
===================================================================
--- trunk/src/jar/util/java/org/mulgara/util/FnE.java (rev 0)
+++ trunk/src/jar/util/java/org/mulgara/util/FnE.java 2008-08-23 01:51:05 UTC (rev 1160)
@@ -0,0 +1,33 @@
+/*
+ * The contents of this file are subject to the Open Software License
+ * Version 3.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.opensource.org/licenses/osl-3.0.txt
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ */
+
+package org.mulgara.util;
+
+/**
+ * Functor template for a function that accepts no parameters, and has a return type.
+ * An exception may be thrown.
+ *
+ * @created Aug 4, 2008
+ * @author Paul Gearon
+ * @copyright © 2008 <a href="http://www.topazproject.org/">The Topaz Project</a>
+ * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
+ */
+public interface FnE<T1,E extends Exception> {
+
+ /**
+ * Declares a function template that takes no arguments and returns a value.
+ * @return A calculated value.
+ * @throws E Can throw an exception of this type.
+ */
+ T1 fn() throws E;
+
+}
More information about the Mulgara-svn
mailing list