Package weka.core
Class SelectedTag
- java.lang.Object
-
- weka.core.SelectedTag
-
- All Implemented Interfaces:
Serializable,RevisionHandler
public class SelectedTag extends Object implements RevisionHandler, Serializable
Represents a selected value from a finite set of values, where each value is a Tag (i.e. has some string associated with it). Primarily used in schemes to select between alternative behaviours, associating names with the alternative behaviours.- Version:
- $Revision$
- Author:
- Len Trigg
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SelectedTag(int tagID, Tag[] tags)Creates a newSelectedTaginstance.SelectedTag(String tagText, Tag[] tags)Creates a newSelectedTaginstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Returns true if this SelectedTag equals another objectStringgetRevision()Returns the revision string.TaggetSelectedTag()Gets the selected Tag.Tag[]getTags()Gets the set of all valid Tags.StringtoString()returns the selected tag in string representation
-
-
-
Constructor Detail
-
SelectedTag
public SelectedTag(int tagID, Tag[] tags)Creates a newSelectedTaginstance.- Parameters:
tagID- the id of the selected tag.tags- an array containing the possible valid Tags.- Throws:
IllegalArgumentException- if the selected tag isn't in the array of valid values or the IDs/IDStrs are not unique.
-
SelectedTag
public SelectedTag(String tagText, Tag[] tags)
Creates a newSelectedTaginstance.- Parameters:
tagText- the text of the selected tag (case-insensitive).tags- an array containing the possible valid Tags.- Throws:
IllegalArgumentException- if the selected tag isn't in the array of valid values.
-
-
Method Detail
-
equals
public boolean equals(Object o)
Returns true if this SelectedTag equals another object
-
getSelectedTag
public Tag getSelectedTag()
Gets the selected Tag.- Returns:
- the selected Tag.
-
getTags
public Tag[] getTags()
Gets the set of all valid Tags.- Returns:
- an array containing the valid Tags.
-
toString
public String toString()
returns the selected tag in string representation
-
getRevision
public String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
-