Package de.swa.gc

Class GraphCode

java.lang.Object
de.swa.gc.GraphCode
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ExplainableGraphCode, SemanticGraphCode

public class GraphCode
extends java.lang.Object
implements java.io.Serializable
Implementation of a Graph Code as a 2D representation of MMIR features
Author:
stefan_wagenpfeil
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    GraphCode()  
  • Method Summary

    Modifier and Type Method Description
    void addGraphCode​(GraphCode gc)
    adds a Graph Code to a collection
    java.util.Vector<GraphCode> getCollectionElements()
    returns the elements of a Graph Code collection
    java.util.Vector<java.lang.String> getDictionary()
    the Graph Code Dictionary contains a list of feature vocabulary terms
    int getEdgeValueForTerms​(java.lang.String term1, java.lang.String term2)
    returns the matrix value for two feature vocabulary terms
    int[][] getRelationships()  
    int getValue​(int x, int y)
    returns the matrix value on position x and y
    boolean isCollection()
    returns, if the Graph Code is part of a collection or a single Graph Code
    void setDictionary​(java.util.Vector<java.lang.String> d)
    sets the dictionary of the Graph Code, i.e. the list of feature vocabulary terms
    void setValue​(int x, int y, int v)
    sets the matrix value of position x and y
    void setValueForTerms​(java.lang.String term1, java.lang.String term2, int val)
    sets the matrix value for two feature vocabulary terms
    java.lang.String toString()
    returns a JSon representation of this Graph Cocde

    Methods inherited from class java.lang.Object

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

  • Method Details

    • getDictionary

      public java.util.Vector<java.lang.String> getDictionary()
      the Graph Code Dictionary contains a list of feature vocabulary terms
    • getRelationships

      public int[][] getRelationships()
    • addGraphCode

      public void addGraphCode​(GraphCode gc)
      adds a Graph Code to a collection
    • getCollectionElements

      public java.util.Vector<GraphCode> getCollectionElements()
      returns the elements of a Graph Code collection
    • setDictionary

      public void setDictionary​(java.util.Vector<java.lang.String> d)
      sets the dictionary of the Graph Code, i.e. the list of feature vocabulary terms
    • isCollection

      public boolean isCollection()
      returns, if the Graph Code is part of a collection or a single Graph Code
    • getValue

      public int getValue​(int x, int y)
      returns the matrix value on position x and y
    • setValue

      public void setValue​(int x, int y, int v)
      sets the matrix value of position x and y
    • getEdgeValueForTerms

      public int getEdgeValueForTerms​(java.lang.String term1, java.lang.String term2)
      returns the matrix value for two feature vocabulary terms
    • setValueForTerms

      public void setValueForTerms​(java.lang.String term1, java.lang.String term2, int val)
      sets the matrix value for two feature vocabulary terms
    • toString

      public java.lang.String toString()
      returns a JSon representation of this Graph Cocde
      Overrides:
      toString in class java.lang.Object