Documentation of 'cc.redberry.core.indices.StructureOfIndices' Java class
StructureOfIndices
cc.redberry.core.indices

Class StructureOfIndices



  • public final class StructureOfIndices
    extends java.lang.Object
    The unique identification information about indices objects. This class contains information about types of indices (number of indices of each type) and about states of non metric indices (if there are any).
    Since:
    1.0
    See Also:
    NameDescriptor
    • Method Detail

      • create

        public static StructureOfIndices create(byte type,
                                                int count,
                                                boolean... states)
        Creates structure of indices, which contains indices only of specified type.
        Parameters:
        type - index type
        count - number of indices
        states - indices states
      • create

        public static StructureOfIndices create(byte type,
                                                int count)
        Creates structure of indices, which contains indices only of specified metric type.
        Parameters:
        type - index type
        count - number of indices
        Throws:
        java.lang.IllegalArgumentException - if type is non metric
      • create

        public static StructureOfIndices create(IndexType type,
                                                int count)
        Creates structure of indices, which contains indices only of specified metric type.
        Parameters:
        type - index type
        count - number of indices
        Throws:
        java.lang.IllegalArgumentException - if type is non metric
      • create

        public static StructureOfIndices create(byte[] types,
                                                int[] count)
        Creates structure of indices from specified data about metric indices.
        Parameters:
        types - array of types
        count - array of sizes of indices of specified types
        Throws:
        java.lang.IllegalArgumentException - if any type in type is non metric
      • create

        public static StructureOfIndices create(int[] allCount,
                                                BitArray[] allStates)
        Creates structure of indices from specified data.
        Parameters:
        allCount - array of sizes of indices of all types
        allStates - array of states of indices of all types
        Throws:
        java.lang.IllegalArgumentException - allCount.length() != allStates.length()
        java.lang.IllegalArgumentException - if length of allCount not equal the total number of available types of inddices.
      • create

        public static StructureOfIndices create(SimpleIndices indices)
        Returns the structure of specified simple indices.
        Parameters:
        indices - simple indices
      • getStates

        public BitArray[] getStates()
        Returns states.
        Returns:
        states
      • getStates

        public BitArray getStates(IndexType type)
        Returns states of specified type.
        Returns:
        states of specified type
      • fixedStates

        public boolean fixedStates(IndexType type)
        Returns whether states of specified type are set.
        Returns:
        whether states of specified type are set
      • getTypesCounts

        public int[] getTypesCounts()
        Returns sizes of indices of all types.
        Returns:
        sizes of indices of all types
      • size

        public int size()
        Returns the total number of indices.
        Returns:
        total number of indices
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getTypeData

        public StructureOfIndices.TypeData getTypeData(byte type)
        Returns the information about specified type.
        Parameters:
        type - index type
        Returns:
        the information about specified type
      • typeCount

        public int typeCount(byte type)
        Returns the number of indices of specified type.
        Parameters:
        type - index type
        Returns:
        the number of indices of specified type
      • isStructureOf

        public boolean isStructureOf(SimpleIndices indices)
        Returns true if this is structure of specified indices.
        Parameters:
        indices - indices
        Returns:
        true if this is structure of specified indices
      • getInverted

        public StructureOfIndices getInverted()
        Return the new Structure of Indices with inverted states of indices
        Returns:
        new Structure of Indices with inverted states of indices
      • append

        public StructureOfIndices append(StructureOfIndices oth)
        Returns the 'sum' of this and other structures
        Parameters:
        oth - other structure
        Returns:
        'sum' of this and other structures
      • pow

        public StructureOfIndices pow(int N)
        Returns the 'sum' of N-copies of this
        Parameters:
        N - exponent
        Returns:
        'sum' of N-copies of this
      • subtract

        public StructureOfIndices subtract(StructureOfIndices other)
        Subtracts some structure of indices from the right side of current structure.

        This operation may fail if states of other structure differs from current.

        Parameters:
        other - other structure
        Returns:
        result of subtraction
        Throws:
        java.lang.IllegalArgumentException - nonmetric states are different
      • getPartitionMappings

        public int[][] getPartitionMappings(StructureOfIndices... partition)
        Calculates partition of this structure by the specified structures and returns the resulting map. This map organized as follows: map[i][j] represents the index of this, which matches j-th index of i-th structure in specified partition
        Parameters:
        partition -
        Returns:
        map which encodes partition of this structure by the specified structures
        Throws:
        java.lang.IllegalArgumentException - if specified array does not form a partition
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.