Class Examples
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<Example>
-
- Examples
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<Example>
,java.util.Collection<Example>
,java.util.List<Example>
,java.util.RandomAccess
public class Examples extends java.util.ArrayList<Example>
Stores examples for data sets for machine learning.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Attributes
attributes
the attributes structure for these examples
-
Constructor Summary
Constructors Constructor Description Examples(Attributes attributes)
Explicit constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
parse(java.util.Scanner scanner)
Given the attributes structure, parses the tokens in the scanner, makes Examples, and adds them to this Examples object.java.lang.String
toString()
Returns a string representation of this Examples object.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Field Detail
-
attributes
private Attributes attributes
the attributes structure for these examples
-
-
Constructor Detail
-
Examples
public Examples(Attributes attributes)
Explicit constructor.- Parameters:
attributes
- the attributes for this set of examples
-
-
Method Detail
-
parse
public void parse(java.util.Scanner scanner) throws java.lang.Exception
Given the attributes structure, parses the tokens in the scanner, makes Examples, and adds them to this Examples object.- Parameters:
scanner
- a Scanner containing the examples' tokens- Throws:
java.lang.Exception
- if an index is out of bounds or if a parse error occurs
-
toString
public java.lang.String toString()
Returns a string representation of this Examples object.- Overrides:
toString
in classjava.util.AbstractCollection<Example>
- Returns:
- a string representation of this Examples object
-
-