org.apache.ignite.ml.math.primitives.vector.impl

## Class DelegatingNamedVector

- java.lang.Object
- - org.apache.ignite.ml.math.primitives.vector.impl.DelegatingVector
  - - org.apache.ignite.ml.math.primitives.vector.impl.DelegatingNamedVector

- All Implemented Interfaces:
    Externalizable, Serializable, Destroyable, MetaAttributes, NamedVector, Vector, StorageOpsMetrics

      public class DelegatingNamedVector
      extends DelegatingVector
      implements NamedVector

  Delegating named vector that delegates all operations to underlying vector and adds implementation of `NamedVector` functionality using embedded map that maps string index on real integer index.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.ignite.ml.math.primitives.vector.Vector

      `Vector.Element`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DelegatingNamedVector()` Constructs a new instance of delegating named vector.
    `DelegatingNamedVector(Vector vector, Map<String,Integer> map)` Constructs a new instance of delegating named vector.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `get(String idx)` Returns element with specified string index.
    `Set<String>` | `getKeys()` Returns list of string indexes used in this vector.
    `void` | `readExternal(ObjectInput in)`
    `NamedVector` | `set(String idx, double val)` Sets element with specified string index and value.
    `void` | `writeExternal(ObjectOutput out)`

    - ### Methods inherited from class org.apache.ignite.ml.math.primitives.vector.impl.DelegatingVector

      `all, allSpliterator, assign, assign, assign, assign, compute, copy, copyOfRange, cross, destroy, divide, dot, equals, foldMap, foldMap, get, getDistanceSquared, getElement, getLengthSquared, getMetaStorage, getRaw, getRawX, getStorage, getVector, getX, guid, hashCode, increment, incrementX, isArrayBased, isDense, isNumeric, kNorm, like, likeMatrix, logNormalize, logNormalize, map, map, map, maxElement, maxValue, minElement, minus, minValue, nonZeroElements, nonZeroes, nonZeroSpliterator, normalize, normalize, plus, plus, set, setRaw, setRawX, setX, size, sort, sum, times, times, toMatrix, toMatrixPlusOne, viewPart`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.ignite.ml.math.primitives.vector.Vector

      `all, allSpliterator, asArray, assign, assign, assign, assign, compute, copy, copyOfRange, cross, divide, dot, foldMap, foldMap, get, getDistanceSquared, getElement, getLengthSquared, getRaw, getRawX, getStorage, getX, guid, increment, incrementX, kNorm, labeled, like, likeMatrix, logNormalize, logNormalize, map, map, map, maxElement, maxValue, minElement, minus, minValue, nonZeroElements, nonZeroes, nonZeroSpliterator, normalize, normalize, plus, plus, set, setRaw, setRawX, setX, size, sort, sum, times, times, toMatrix, toMatrixPlusOne, viewPart`

    - ### Methods inherited from interface org.apache.ignite.ml.math.MetaAttributes

      `getAttribute, getMetaStorage, hasAttribute, removeAttribute, setAttribute`

    - ### Methods inherited from interface org.apache.ignite.ml.math.StorageOpsMetrics

      `isArrayBased, isDense, isNumeric`

    - ### Methods inherited from interface org.apache.ignite.ml.math.Destroyable

      `destroy`

- - ### Constructor Detail

    - #### DelegatingNamedVector

          public DelegatingNamedVector()

      Constructs a new instance of delegating named vector.

    - #### DelegatingNamedVector

          public DelegatingNamedVector(Vector vector,
                                       Map<String,Integer> map)

      Constructs a new instance of delegating named vector.
      Parameters:
        `vector` - Underlying vector.
        `map` - Map that maps string index on real integer index.

  - ### Method Detail

    - #### get

          public double get(String idx)

      Returns element with specified string index.
      Specified by:
        `get` in interface `NamedVector`
      Parameters:
        `idx` - Element string index.
      Returns:
        Element value.

    - #### set

          public NamedVector set(String idx,
                                 double val)

      Sets element with specified string index and value.
      Specified by:
        `set` in interface `NamedVector`
      Parameters:
        `idx` - Element string index.
        `val` - Element value.
      Returns:
        This vector.

    - #### getKeys

          public Set<String> getKeys()

      Returns list of string indexes used in this vector.
      Specified by:
        `getKeys` in interface `NamedVector`
      Returns:
        List of string indexes used in this vector.

    - #### writeExternal

          public void writeExternal(ObjectOutput out)
                             throws IOException

      Specified by:
        `writeExternal` in interface `Externalizable`
      Overrides:
        `writeExternal` in class `DelegatingVector`
      Throws:
        `IOException`

    - #### readExternal

          public void readExternal(ObjectInput in)
                            throws IOException,
                                   ClassNotFoundException

      Specified by:
        `readExternal` in interface `Externalizable`
      Overrides:
        `readExternal` in class `DelegatingVector`
      Throws:
        `IOException`
        `ClassNotFoundException`

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022