Author: tommaso
Date: Fri Mar 22 15:03:14 2013
New Revision: 1459828
URL: http://svn.apache.org/r1459828
Log:
refactoring API (added training set)
Added:
labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingSet.java (with
props)
Added: labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingSet.java
URL:
http://svn.apache.org/viewvc/labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingSet.java?rev=1459828&view=auto
==============================================================================
--- labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingSet.java (added)
+++ labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingSet.java Fri Mar 22
15:03:14 2013
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.yay;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * A collection of {@link TrainingExample}s.
+ */
+public class TrainingSet<F, O> implements Iterable<TrainingExample<F, O>> {
+
+ private Collection<TrainingExample<F, O>> samples;
+
+ public TrainingSet(Collection<TrainingExample<F, O>> samples) {
+ this.samples = samples;
+ }
+
+ @Override
+ public Iterator<TrainingExample<F, O>> iterator() {
+ return samples.iterator();
+ }
+
+ public int size() {
+ return samples.size();
+ }
+}
Propchange: labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingSet.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]