knn
Class Features

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--knn.Features
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class Features
extends java.util.Vector

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

See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Features()
           
Features(float[][] fts, int startindex, java.lang.String name)
           
 
Method Summary
 void add(Feature newfeature)
          Add the elements in newfeatures to features.
 void add(Feature[] newfeatures)
          Add the elements in newfeatures to features.
 void add(java.util.Vector newfeatures)
          Deprecated.  
 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, removeRange, 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
, finalize, 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(Feature newfeature)
Add the elements in newfeatures to features.

add

public void add(java.util.Vector newfeatures)
Deprecated.  

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)