title: Creating a string attribute in Weka Java API
body: <p>I'm trying to create a new string Attribute using Weka's Java API...</p>
  
  <p>Reading through the API javadocs, it appears that the way to do so is to use this constructor: </p>
  
  <pre><code>Attribute
  
  public Attribute(java.lang.String attributeName,
                   FastVector attributeValues)
  
      Constructor for nominal attributes and string attributes. If a null vector of attribute values is passed to the method, the attribute is assumed to be a string.
  
      Parameters:
          attributeName - the name for the attribute
          attributeValues - a vector of strings denoting the attribute values. Null if the attribute is a string attribute.
  </code></pre>
  
  <p>but I'm stuck as to what I should pass into the attributeValues parameter...</p>
  
  <p>when I put in null, Java complains about protected objects<br>
  when I put in Null, it's syntax error<br>
  when I put in <code>new FastVector()</code>, it becomes a nominal attribute that is empty rather than a string attribute...<br>
  when I create a new object: </p>
  
  <pre><code>FastVector fv = new FastVector();
  fv.addElement(null);
  </code></pre>
  
  <p>and then pass fv into the argument, it returns a null pointer exception...</p>
  
  <p>what exactly should I put into the attributeValues argument so that it becomes a string attribute? </p>