it.unipd.dei.ims.nestor.experiment.primitives
Class ArrayBasedNSMContentQueryOperations

java.lang.Object
  extended by it.unipd.dei.ims.nestor.experiment.primitives.ArrayBasedNSMContentQueryOperations

public class ArrayBasedNSMContentQueryOperations
extends java.lang.Object

This class defines the NS-M (DDS) primitives using an array-based data structure.

Author:
Gianmaria Silvello

Constructor Summary
ArrayBasedNSMContentQueryOperations()
           
 
Method Summary
static int[] ancestorElementsOpt(int[][] directSubsets, int[][] supersets, int[][] elements, int set)
          Implements the ancestor content primitive for DDS (straightforward implementation of the NS-M).
static java.lang.String[] ancestorElementsOpt(int[][] directSubsets, int[][] supersets, int[][] elements, java.lang.String[] content, int set)
          Implements the ancestor content primitive for DDS (straightforward implementation of the NS-M).
static int[] childrenElements(int[][] directSubsets, int[][] supersets, int[][] elements, int set)
          Implements the children primitive for DDS (straightforward implementation of the NS-M).
static java.lang.String[] childrenElements(int[][] directSubsets, int[][] supersets, int[][] elements, java.lang.String[] content, int set)
          Implements the children content primitive for DDS (straightforward implementation of the NS-M).
static java.lang.String[] descendantElements(int[][] elements, java.lang.String[] content, int set)
          Implements the descendants primitive for DDS (straightforward implementation of the NS-M).
static int[] parentElementsOpt(int[][] directSubsets, int[][] supersets, int[][] elements, int set)
          Implements the parent content primitive for DDS (straightforward implementation of the NS-M).
static java.lang.String[] parentElementsOpt(int[][] directSubsets, int[][] supersets, int[][] elements, java.lang.String[] content, int set)
          Implements the parent content primitive for DDS (straightforward implementation of the NS-M).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayBasedNSMContentQueryOperations

public ArrayBasedNSMContentQueryOperations()
Method Detail

descendantElements

public static java.lang.String[] descendantElements(int[][] elements,
                                                    java.lang.String[] content,
                                                    int set)
Implements the descendants primitive for DDS (straightforward implementation of the NS-M).

Parameters:
directSubsets - the matrix with the direct subsets of the given set. Each set is represented by a single integer value.
supersets - the matrix with the supersets of the given set. Each set is represented by a single integer value.
elements - the matrix with the elements of the given set. Each element is represented by a single integer value.
content - the array with the strings associated to the elements.
set - the given set.
Returns:
the values of the elements belonging to the descendants of the given set.

ancestorElementsOpt

public static int[] ancestorElementsOpt(int[][] directSubsets,
                                        int[][] supersets,
                                        int[][] elements,
                                        int set)
Implements the ancestor content primitive for DDS (straightforward implementation of the NS-M).

Parameters:
directSubsets - the matrix with the direct subsets of the given set. Each set is represented by a single integer value.
supersets - the matrix with the supersets of the given set. Each set is represented by a single integer value.
elements - the matrix with the elements of the given set. Each element is represented by a single integer value.
content - the array with the strings associated to the elements.
set - the given set.
Returns:
the values of the elements belonging to the ancestors of the given set.

ancestorElementsOpt

public static java.lang.String[] ancestorElementsOpt(int[][] directSubsets,
                                                     int[][] supersets,
                                                     int[][] elements,
                                                     java.lang.String[] content,
                                                     int set)
Implements the ancestor content primitive for DDS (straightforward implementation of the NS-M).

Parameters:
directSubsets - the matrix with the direct subsets of the given set. Each set is represented by a single integer value.
supersets - the matrix with the supersets of the given set. Each set is represented by a single integer value.
elements - the matrix with the elements of the given set. Each element is represented by a single integer value.
content - the array with the strings associated to the elements.
set - the given set.
Returns:
the string values of the elements belonging to the ancestors of the given set.

childrenElements

public static int[] childrenElements(int[][] directSubsets,
                                     int[][] supersets,
                                     int[][] elements,
                                     int set)
Implements the children primitive for DDS (straightforward implementation of the NS-M).

Parameters:
directSubsets - the matrix with the direct subsets of the given set. Each set is represented by a single integer value.
supersets - the matrix with the supersets of the given set. Each set is represented by a single integer value.
elements - the matrix with the elements of the given set. Each element is represented by a single integer value.
set - the given set.
Returns:
the values of the elements belonging to the children of the given set.

childrenElements

public static java.lang.String[] childrenElements(int[][] directSubsets,
                                                  int[][] supersets,
                                                  int[][] elements,
                                                  java.lang.String[] content,
                                                  int set)
Implements the children content primitive for DDS (straightforward implementation of the NS-M).

Parameters:
directSubsets - the matrix with the direct subsets of the given set. Each set is represented by a single integer value.
supersets - the matrix with the supersets of the given set. Each set is represented by a single integer value.
elements - the matrix with the elements of the given set. Each element is represented by a single integer value.
content - the array with the strings associated to the elements.
set - the given set.
Returns:
the string values of the elements belonging to the children of the given set.

parentElementsOpt

public static int[] parentElementsOpt(int[][] directSubsets,
                                      int[][] supersets,
                                      int[][] elements,
                                      int set)
Implements the parent content primitive for DDS (straightforward implementation of the NS-M).

Parameters:
directSubsets - the matrix with the direct subsets of the given set. Each set is represented by a single integer value.
supersets - the matrix with the supersets of the given set. Each set is represented by a single integer value.
elements - the matrix with the elements of the given set. Each element is represented by a single integer value.
content - the array with the strings associated to the elements.
set - the given set.
Returns:
the values of the elements belonging to the parent of the given set.

parentElementsOpt

public static java.lang.String[] parentElementsOpt(int[][] directSubsets,
                                                   int[][] supersets,
                                                   int[][] elements,
                                                   java.lang.String[] content,
                                                   int set)
Implements the parent content primitive for DDS (straightforward implementation of the NS-M).

Parameters:
directSubsets - the matrix with the direct subsets of the given set. Each set is represented by a single integer value.
supersets - the matrix with the supersets of the given set. Each set is represented by a single integer value.
elements - the matrix with the elements of the given set. Each element is represented by a single integer value.
content - the array with the strings associated to the elements.
set - the given set.
Returns:
the string values of the elements belonging to the parent of the given set.