java.lang.Object
ubic.gemma.model.analysis.expression.coexpression.IdArray
Direct Known Subclasses:
GeneCoexpressedGenes, GeneCoexpressionTestedIn, IdArrayValueObject, SupportDetails

public abstract class IdArray extends Object
Represents a set of IDs for entities (e.g., genes or experiments), stored in a bitSet.
Author:
Paul
  • Field Details

    • data

      protected com.googlecode.javaewah.EWAHCompressedBitmap data
  • Constructor Details

    • IdArray

      public IdArray()
  • Method Details

    • addEntities

      public void addEntities(Collection<Long> ids)
    • addEntity

      public void addEntity(Long ds)
      Add the data set to the list of those which are in the array. If it is already included, nothing will change.
      Parameters:
      ds - this is cast to an int
      Throws:
      IllegalArgumentException - if the value is too larger to be stored as an integer.
    • and

      public Collection<Long> and(IdArray other)
      Parameters:
      other - the other idArray to compare with.
      Returns:
      datasets IDs it has in common with this.
    • andSet

      public Set<Long> andSet(IdArray other)
      Parameters:
      other - the other idArray to compare with.
      Returns:
      datasets IDs it has in common with this, as a set
    • getBytes

      public byte[] getBytes()
    • setBytes

      public void setBytes(byte[] bytes)
    • getIds

      public Collection<Long> getIds()
      Returns:
      datasets IDs
    • getIdsSet

      public Set<Long> getIdsSet()
      Returns:
      set representation
    • getNumIds

      public int getNumIds()
      Returns:
      how many datasets there are
    • isIncluded

      public boolean isIncluded(Long g)
      Use 'and' instead if possible.
      Parameters:
      g - the id to check for
      Returns:
      true if the given id is in this array
    • removeEntity

      public void removeEntity(Long ds)
      Parameters:
      ds - ID of dataset to remove. If it isn't here, has no effect.
    • toString

      public String toString()
      Overrides:
      toString in class Object