cosc575.p1
Class Examples

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Example>
              extended by cosc575.p1.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>

Implements a class for storing examples.

See Also:
Serialized Form

Field Summary
private  Attributes attributes
          the attributes structure for these examples
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Examples(Attributes attributes)
          Explicit constructor.
Examples(Attributes attributes, java.util.Scanner scanner)
          Given the attributes structure, processes the tokens in the scanner and populates the ArrayList of Doubles.
 
Method Summary
 java.lang.String toString()
          Returns a string representation of the examples.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
containsAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode
 

Field Detail

attributes

private Attributes attributes
the attributes structure for these examples

Constructor Detail

Examples

public Examples(Attributes attributes)
         throws java.lang.Exception
Explicit constructor.

Parameters:
attributes - the attributes for this set of examples
Throws:
Expection - if an exception occurs
java.lang.Exception

Examples

public Examples(Attributes attributes,
                java.util.Scanner scanner)
         throws java.lang.Exception
Given the attributes structure, processes the tokens in the scanner and populates the ArrayList of Doubles. Numeric values are stored as is. Discrete values are stored as Doubles. Nominal values are stored as Doubles and are indices of the value in the attributes structure.

Parameters:
attributes - a attributes structure
scanner - a Scanner containing the examples' tokens
Throws:
java.lang.Exception
Method Detail

toString

public java.lang.String toString()
Returns a string representation of the examples.

Overrides:
toString in class java.util.AbstractCollection<Example>
Returns:
a string representation of the examples