public class InputContainer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Vector<java.lang.Double> |
inputDistances |
private java.util.Vector<java.lang.String> |
inputNames |
Constructor and Description |
---|
InputContainer()
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addMappedInput(java.lang.String name,
java.lang.Double dist)
Adds an input datum defined by argument
name and distance to the list. |
void |
clearMappedInputs()
Clears all input data.
|
int |
getInputIndex(java.lang.String name)
Finds the index for a given input name.
|
double |
getMappedInputDistance(int index)
Returns the distance between this unit's weight vector and the vector of the mapped input data at the specified
index . |
double |
getMappedInputDistance(java.lang.String label) |
double[] |
getMappedInputDistances()
Returns an array of distances between this unit's weight vector and the vectors of the mapped input data.
|
java.lang.String |
getMappedInputName(int index)
Returns the name identifier of the mapped input data at the specified
index . |
java.lang.String[] |
getMappedInputNames()
Returns an array of strings containing the identifiers of the mapped input data.
|
java.util.Vector<java.lang.String> |
getMappedInputNamesAsList() |
int |
getNumberOfMappedInputs()
Returns the number of mapped input data.
|
boolean |
isMapped(java.lang.String name)
Checks if an input datum with identifier
name is mapped onto this container. |
void |
removeMappedInput(java.lang.String label) |
private java.util.Vector<java.lang.Double> inputDistances
private java.util.Vector<java.lang.String> inputNames
protected void addMappedInput(java.lang.String name, java.lang.Double dist)
name
and distance
to the list. It is inserted
at a position to retain ordering by ascending distance. If two inputs have the same distance, ordering is
lexicographically.name
- the identification string of the input datum.dist
- the distance between a unit's weight vector and the inptu datum. This value is precalcuated and
independent from this class.public int getNumberOfMappedInputs()
public void clearMappedInputs()
number
variable
to 0 accordingly.public double[] getMappedInputDistances()
public double getMappedInputDistance(int index)
index
.List.get(int)
public double getMappedInputDistance(java.lang.String label) throws SOMToolboxException
SOMToolboxException
public java.lang.String[] getMappedInputNames()
getMappedInputDistances()
.public java.util.Vector<java.lang.String> getMappedInputNamesAsList()
public java.lang.String getMappedInputName(int index)
index
.List.get(int)
public int getInputIndex(java.lang.String name)
public boolean isMapped(java.lang.String name)
name
is mapped onto this container.name
- the name of the input datum to be checked.true
if an input datum with identifier specified by argument name
is mapped
onto this unit, false
otherwise.public void removeMappedInput(java.lang.String label)