org.apache.mahout.df.data
Class DescriptorUtils

java.lang.Object
  extended by org.apache.mahout.df.data.DescriptorUtils

public class DescriptorUtils
extends java.lang.Object

Contains various methods that deal with descriptor strings


Method Summary
static java.lang.String generateDescriptor(java.util.List<java.lang.String> tokens)
          Generates a valid descriptor string from a list of tokens
static java.lang.String generateDescriptor(java.lang.String description)
          Generates a valid descriptor string from a user-friendly representation.
for example "3 N I N N 2 C L 5 I" generates "N N N I N N C C L I I I I I".
this useful when describing datasets with a large number of attributes
static Dataset.Attribute[] parseDescriptor(java.lang.String descriptor)
          Parses a descriptor string and generates the corresponding array of Attributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseDescriptor

public static Dataset.Attribute[] parseDescriptor(java.lang.String descriptor)
                                           throws DescriptorException
Parses a descriptor string and generates the corresponding array of Attributes

Parameters:
descriptor -
Returns:
Throws:
DescriptorException - if a bad token is encountered

generateDescriptor

public static java.lang.String generateDescriptor(java.lang.String description)
                                           throws DescriptorException
Generates a valid descriptor string from a user-friendly representation.
for example "3 N I N N 2 C L 5 I" generates "N N N I N N C C L I I I I I".
this useful when describing datasets with a large number of attributes

Parameters:
description -
Returns:
Throws:
DescriptorException

generateDescriptor

public static java.lang.String generateDescriptor(java.util.List<java.lang.String> tokens)
                                           throws DescriptorException
Generates a valid descriptor string from a list of tokens

Parameters:
tokens -
Returns:
Throws:
DescriptorException


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.