public class StringLocator extends AttributeLocator
Attribute.STRING
,
Attribute.RELATIONAL
,
Serialized FormConstructor and Description |
---|
StringLocator(Instances data)
initializes the StringLocator with the given data
|
StringLocator(Instances data,
int[] indices)
Initializes the AttributeLocator with the given data.
|
StringLocator(Instances data,
int fromIndex,
int toIndex)
Initializes the StringLocator with the given data.
|
Modifier and Type | Method and Description |
---|---|
static void |
copyStringValues(Instance instance,
boolean instSrcCompat,
Instances srcDataset,
AttributeLocator srcLoc,
Instances destDataset,
AttributeLocator destLoc)
Takes string values referenced by an Instance and copies them from a
source dataset to a destination dataset.
|
static void |
copyStringValues(Instance inst,
Instances destDataset,
AttributeLocator strAtts)
Copies string values contained in the instance copied to a new
dataset.
|
java.lang.String |
getRevision()
Returns the revision string.
|
compareTo, equals, getActualIndex, getAllowedIndices, getAttributeIndices, getData, getLocator, getLocatorIndices, getType, toString
public StringLocator(Instances data)
data
- the data to work onpublic StringLocator(Instances data, int fromIndex, int toIndex)
data
- the data to work onfromIndex
- the first index to inspect (including)toIndex
- the last index to check (including)public StringLocator(Instances data, int[] indices)
data
- the data to work onindices
- the attribute indices to checkpublic static void copyStringValues(Instance inst, Instances destDataset, AttributeLocator strAtts)
inst
- the Instance containing the string values to copy.destDataset
- the destination set of InstancesstrAtts
- an AttributeLocator containing the indices of
any string attributes in the dataset.public static void copyStringValues(Instance instance, boolean instSrcCompat, Instances srcDataset, AttributeLocator srcLoc, Instances destDataset, AttributeLocator destLoc)
instance
- the instance containing references to strings
in the source dataset that will have references
updated to be valid for the destination dataset.instSrcCompat
- true if the instance structure is the same as
the source, or false if it is the same as the
destination (i.e. which of the string attribute
indices contains the correct locations for this
instance).srcDataset
- the dataset for which the current instance
string references are valid (after any position
mapping if needed)srcLoc
- an AttributeLocator containing the indices of
string attributes in the source datset.destDataset
- the dataset for which the current instance
string references need to be inserted (after
any position mapping if needed)destLoc
- an AttributeLocator containing the indices of
string attributes in the destination datset.public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AttributeLocator