java.lang.Object
com.semedy.reasoner.reasoning.processes.Mapping

public class Mapping extends Object
Describes a mapping of reasoning relation arguments map[i] maps argument position i to another one
Author:
angele
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int[]
    the mapping
  • Constructor Summary

    Constructors
    Constructor
    Description
    Mapping(int arity)
    identity mapping
    Mapping(int[] map)
    given is mapping
    Mapping(int[] source, int[] dest, int arity)
    compute mapping
  • Method Summary

    Modifier and Type
    Method
    Description
    clone a mapping
    int
    get(int i)
    get the mapped index
    int
    get the arity of the mapping
    int[]
    get the whole mapping
    invert a mapping
    int
    get length of mapping
    concatenate two mappings first m, then this
    void
    set(int[] map)
    set the whole mapping
    void
    set(int i, int j)
    map index i to j
    shrinkArity(int arity)
    shrink arity of mapping
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • _map

      public int[] _map
      the mapping
  • Constructor Details

    • Mapping

      public Mapping(int[] map)
      given is mapping
      Parameters:
      map -
    • Mapping

      public Mapping(int arity)
      identity mapping
      Parameters:
      arity -
    • Mapping

      public Mapping(int[] source, int[] dest, int arity)
      compute mapping
      Parameters:
      source -
      dest -
      arity -
  • Method Details

    • length

      public int length()
      get length of mapping
      Returns:
    • map

      public Mapping map(Mapping m)
      concatenate two mappings first m, then this
      Parameters:
      m -
      Returns:
    • invert

      public Mapping invert()
      invert a mapping
      Returns:
    • clone

      public Mapping clone()
      clone a mapping
    • shrinkArity

      public Mapping shrinkArity(int arity)
      shrink arity of mapping
      Parameters:
      arity -
      Returns:
    • getArity

      public int getArity()
      get the arity of the mapping
      Returns:
    • get

      public int get(int i)
      get the mapped index
      Parameters:
      i -
      Returns:
    • set

      public void set(int i, int j)
      map index i to j
      Parameters:
      i -
      j -
    • set

      public void set(int[] map)
      set the whole mapping
      Parameters:
      map -
    • getMapping

      public int[] getMapping()
      get the whole mapping
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object