Documentation of 'mikera.indexz.AIndex' Java class
AIndex
mikera.indexz

Class AIndex

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AIndex>, java.lang.Iterable<java.lang.Integer>
    Direct Known Subclasses:
    ComputedIndex, GrowableIndex, Index


    public abstract class AIndex
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AIndex>, java.lang.Iterable<java.lang.Integer>
    Abstract base class for a list of integer indexes
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      AIndex() 
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      AIndex clone() 
      int compareTo(AIndex a) 
      Index compose(AIndex a)
      Composes this index with a second index, returning a new index.
      boolean contains(Index inds) 
      boolean contains(int index)
      Returns true if the index contains a specific value.
      boolean containsSorted(int index)
      Returns true if the index contains a specific value.
      void copyTo(int[] array, int offset) 
      boolean equals(AIndex o) 
      boolean equals(java.lang.Object o) 
      abstract AIndex exactClone() 
      abstract int get(int i)
      Gets the index value at position i
      int hashCode() 
      abstract int indexPosition(int x)
      Looks up an index value in the index, returning its position or -1 if not found Index must be both sorted and distinct.
      boolean isDistinct()
      Returns true if this Index contains only distinct integer indices
      boolean isDistinctSorted()
      Returns true if this index is distinct and sorted (in strictly increasing order)
      boolean isFullyMutable() 
      boolean isPermutation()
      Returns true if this index represents a permutation of positions 0..length-1
      boolean isSorted()
      Returns true if this index is sorted (in increasing order)
      IndexIterator iterator()
      Gets an iterator over all elements of this index
      abstract int last()
      Gets the last index value in this index.
      abstract int length()
      Returns the length of this index list
      int maxIndex() 
      int minIndex() 
      void reverse() 
      int seekPosition(int i)
      Returns the position at which an index value exists or should be inserted at in an index Index must be both sorted and distinct.
      abstract void set(int i, int value) 
      void sort()
      Sorts the index in place.
      void swap(int i, int j) 
      int[] toArray() 
      Index toIndex() 
      java.util.List<java.lang.Integer> toList() 
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • AIndex

        public AIndex()
    • Method Detail

      • get

        public abstract int get(int i)
        Gets the index value at position i
        Parameters:
        i -
        Returns:
      • length

        public abstract int length()
        Returns the length of this index list
        Returns:
      • set

        public abstract void set(int i,
                                 int value)
      • isFullyMutable

        public boolean isFullyMutable()
      • copyTo

        public void copyTo(int[] array,
                           int offset)
      • toArray

        public int[] toArray()
      • toIndex

        public Index toIndex()
      • toList

        public java.util.List<java.lang.Integer> toList()
      • swap

        public void swap(int i,
                         int j)
      • reverse

        public void reverse()
      • minIndex

        public int minIndex()
      • maxIndex

        public int maxIndex()
      • isSorted

        public boolean isSorted()
        Returns true if this index is sorted (in increasing order)
        Returns:
      • isDistinctSorted

        public boolean isDistinctSorted()
        Returns true if this index is distinct and sorted (in strictly increasing order)
        Returns:
      • sort

        public void sort()
        Sorts the index in place. May not be supported by some AIndex implementations e.g. if the index is immutable.
      • isDistinct

        public boolean isDistinct()
        Returns true if this Index contains only distinct integer indices
        Returns:
      • isPermutation

        public boolean isPermutation()
        Returns true if this index represents a permutation of positions 0..length-1
        Returns:
      • contains

        public boolean contains(int index)
        Returns true if the index contains a specific value. Performs a full scan of the index (need not be in sorted order)
        Parameters:
        index -
        Returns:
      • containsSorted

        public boolean containsSorted(int index)
        Returns true if the index contains a specific value. Assumes the index is in sorted order.
        Parameters:
        index -
        Returns:
      • contains

        public boolean contains(Index inds)
      • equals

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

        public boolean equals(AIndex o)
      • hashCode

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

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

        public AIndex clone()
        Overrides:
        clone in class java.lang.Object
      • compareTo

        public int compareTo(AIndex a)
        Specified by:
        compareTo in interface java.lang.Comparable<AIndex>
      • iterator

        public IndexIterator iterator()
        Gets an iterator over all elements of this index
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Integer>
      • compose

        public Index compose(AIndex a)
        Composes this index with a second index, returning a new index. New index satisfies index.get(i) == a.get(this.get(i));
        Parameters:
        a -
        Returns:
      • indexPosition

        public abstract int indexPosition(int x)
        Looks up an index value in the index, returning its position or -1 if not found Index must be both sorted and distinct.
        Parameters:
        x -
        Returns:
      • seekPosition

        public int seekPosition(int i)
        Returns the position at which an index value exists or should be inserted at in an index Index must be both sorted and distinct.
        Parameters:
        i -
        Returns:
        The target position in the index, which will satisfy 0 <= position <= this.length()
      • exactClone

        public abstract AIndex exactClone()
      • last

        public abstract int last()
        Gets the last index value in this index. Throws an exception if the index is empty
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.