knn
Class Feature

java.lang.Object
  |
  +--knn.Feature

public class Feature
extends java.lang.Object

Feature defines a feature vector, which is a float[] vector and some other characteristics to make it a feature vector. Copyright (c) 1999-2003, Michael Abramoff. All rights reserved.


Field Summary
 java.lang.String name
           
 float[] vector
           
 
Constructor Summary
Feature(java.lang.String name, byte[] vector)
           
Feature(java.lang.String name, float[] vector)
           
 
Method Summary
static java.util.Vector add(java.util.Vector features, Feature newfeature)
          Add the elements in newfeatures to features.
static java.util.Vector add(java.util.Vector features, Feature[] newfeatures)
          Add the elements in newfeatures to features.
static java.util.Vector add(java.util.Vector features, java.util.Vector newfeatures)
          Add the elements in newfeatures to features.
 int length()
           
static float[][] toMatrix(java.util.Vector features)
           
 java.lang.String toString()
           
static java.lang.String[] toString(java.util.Vector features)
           
 float[] toVector()
           
 void unitvar()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vector

public float[] vector

name

public java.lang.String name
Constructor Detail

Feature

public Feature(java.lang.String name,
               float[] vector)

Feature

public Feature(java.lang.String name,
               byte[] vector)
Method Detail

unitvar

public void unitvar()

toVector

public float[] toVector()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

length

public int length()

toMatrix

public static float[][] toMatrix(java.util.Vector features)

add

public static java.util.Vector add(java.util.Vector features,
                                   Feature[] newfeatures)
Add the elements in newfeatures to features.

add

public static java.util.Vector add(java.util.Vector features,
                                   Feature newfeature)
Add the elements in newfeatures to features.

add

public static java.util.Vector add(java.util.Vector features,
                                   java.util.Vector newfeatures)
Add the elements in newfeatures to features.

toString

public static java.lang.String[] toString(java.util.Vector features)