weka.core.converters
Interface ClassHierarchyParser

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractClassHierarchyParser

public interface ClassHierarchyParser
extends java.io.Serializable

Interface defines required methods for all parsers, which provide a ClassHierarchy. Any instance of an implementing class will need to be initiated by the init-method if a Parser is supposed to validate a given ClassHierarchy with respect to a definition of Instances.

Author:
Arthur Zimek

Method Summary
 ClassHierarchy getClassHierarchy()
          Returns the ClassHierarchy decoded out of the given encodedHierarchy.
 java.lang.String getEncodedHierarchy()
          Returns the currently set encoded hierarchy.
 void init(Instances instanceInfo)
          Initiation of a ClassHierarchyParser should enable it to validate a given encoded hierarchy.
 void setEncodedHierarchy(java.lang.String encodedHierarchy)
          Sets the encoded hierarchy to be decoded by this ClassHierarchyParser.
 boolean validate()
          Validates the currently set EncodedHierarchy with respect to the current initialization.
 

Method Detail

init

public void init(Instances instanceInfo)
          throws UnsupportedAttributeTypeException
Initiation of a ClassHierarchyParser should enable it to validate a given encoded hierarchy.

Parameters:
instanceInfo - the information regarding the type of instances to be covered by a parsed hierarchy
Throws:
UnsupportedAttributeTypeException - any implementation should ensure the class-attribute to be nominal

getClassHierarchy

public ClassHierarchy getClassHierarchy()
                                 throws java.text.ParseException
Returns the ClassHierarchy decoded out of the given encodedHierarchy. Any parser should create a ClassHierarchy out of the currently set encoded hierarchy.

Returns:
ClassHierarchy the ClassHierarchy decoded out of the currently set encodedHierarchy
Throws:
java.text.ParseException - in case of a invalid hierarchy-code with respect to the Instances set int the init(Instances)-method

setEncodedHierarchy

public void setEncodedHierarchy(java.lang.String encodedHierarchy)
Sets the encoded hierarchy to be decoded by this ClassHierarchyParser. The given String could encode the hierarchy in any way supported by the implementing class, e.g. as xml-String, as parentheses-encoded structure or even as filename.

Parameters:
encodedHierarchy - the encoded hierarchy to be decoded

getEncodedHierarchy

public java.lang.String getEncodedHierarchy()
Returns the currently set encoded hierarchy.

Returns:
String the currently set encoded hierarchy

validate

public boolean validate()
                 throws java.text.ParseException
Validates the currently set EncodedHierarchy with respect to the current initialization.

Returns:
boolean true, if the currently set encodedHierarchy is valid with respect to the current initialization
Throws:
java.text.ParseException - if the currently set encodedHIerarchy is invalid in any way