Class IdArray
- java.lang.Object
-
- ubic.gemma.model.analysis.expression.coexpression.IdArray
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
GeneCoexpressedGenes
,GeneCoexpressionTestedIn
,IdArrayValueObject
,SupportDetails
public abstract class IdArray extends Object implements Serializable
Represents a set of IDs for entities (e.g., genes or experiments), stored in a bitSet.- Author:
- Paul
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected com.googlecode.javaewah.EWAHCompressedBitmap
data
-
Constructor Summary
Constructors Constructor Description IdArray()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEntities(Collection<Long> ids)
void
addEntity(Long ds)
Add the data set to the list of those which are in the array.Collection<Long>
and(IdArray other)
Set<Long>
andSet(IdArray other)
byte[]
getBytes()
Collection<Long>
getIds()
Set<Long>
getIdsSet()
int
getNumIds()
boolean
isIncluded(Long g)
Use 'and' instead if possible.void
removeEntity(Long ds)
void
setBytes(byte[] bytes)
String
toString()
-
-
-
Method Detail
-
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
-
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.
-
-