features
Class Features

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<Feature>
              extended by features.Features
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Feature>, java.util.Collection<Feature>, java.util.List<Feature>, java.util.RandomAccess

public class Features
extends java.util.Vector<Feature>

Features defines a collection of features. Copyright (c) 1999-2003, Michael Abramoff. All rights reserved.

See Also:
Serialized Form

Constructor Summary
Features()
           
Features(float[][] fts, int startindex, java.lang.String name)
           
 
Method Summary
 void add(Feature[] newfeatures)
          Add the elements in newfeatures to features.
 void add(java.util.Vector<Feature> newfeatures)
          Add the elements in newfeatures to features.
 int length()
           
 Features sample(int[] indices)
          Return a new Features with all Feature element arrays containing only the elements in indices.
 float[][] subset(int[] indices)
          Return a MxN float[][] matrix with a subset of the current Q features (each N in length), i.e.
 float[][] toMatrix()
           
 java.lang.String toString(int i)
           
 float[] toVector(int i)
           
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

Features

public Features()

Features

public Features(float[][] fts,
                int startindex,
                java.lang.String name)
Method Detail

toMatrix

public float[][] toMatrix()

add

public void add(Feature[] newfeatures)
Add the elements in newfeatures to features.


add

public void add(java.util.Vector<Feature> newfeatures)
Add the elements in newfeatures to features.


subset

public float[][] subset(int[] indices)
Return a MxN float[][] matrix with a subset of the current Q features (each N in length), i.e. only M of the Q features are included. Then transpose the NxM matrix so you end up with M N-dimensional elements.


sample

public Features sample(int[] indices)
Return a new Features with all Feature element arrays containing only the elements in indices.


length

public int length()

toString

public java.lang.String toString(int i)

toVector

public float[] toVector(int i)