Class TupleUtils


  • public class TupleUtils
    extends java.lang.Object
    Util functions for arrays of tuples.
    Version:
    4.7
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int tupleNumber  
      (package private) int[][] tuples  
    • Constructor Summary

      Constructors 
      Constructor Description
      TupleUtils()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int findPositionForInsert​(int[] tuple)
      searches for the position of the tuple in the tuple list.
      int[][] recordTuples​(int[][] ts)
      It recordTuples to store so tuples can be reused across multiple extensional constraints.
      static boolean smallerEqualTuple​(int[] left, int[] right)
      It compares tuples.
      int[][] sortTuples​(int[][] ts)  
      static void sortTuplesWithin​(int[][] ts)
      It sorts tuples.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • tupleNumber

        int tupleNumber
      • tuples

        int[][] tuples
    • Constructor Detail

      • TupleUtils

        public TupleUtils()
    • Method Detail

      • recordTuples

        public int[][] recordTuples​(int[][] ts)
        It recordTuples to store so tuples can be reused across multiple extensional constraints. It can potentially save memory.
        Parameters:
        ts - tuples to be recorded.
        Returns:
        two-dimensional array with tuples.
      • findPositionForInsert

        public int findPositionForInsert​(int[] tuple)
        searches for the position of the tuple in the tuple list.
        Parameters:
        tuple - to be compared to.
        Returns:
        position at which the tuple is stored in tuple list array.
      • sortTuples

        public int[][] sortTuples​(int[][] ts)
        Parameters:
        ts - tuples to be sorted.
        Returns:
        sorted tuples.
      • sortTuplesWithin

        public static void sortTuplesWithin​(int[][] ts)
        It sorts tuples.
        Parameters:
        ts - tuples to be sorted.
      • smallerEqualTuple

        public static boolean smallerEqualTuple​(int[] left,
                                                int[] right)
        It compares tuples.
        Parameters:
        left - tuple to be compared to.
        right - tuple to compar with.
        Returns:
        true if the left tuple is larger than right tuple.