uk.ac.starlink.topcat
Class BitsRowSubset

java.lang.Object
  extended by uk.ac.starlink.topcat.RowSubset
      extended by uk.ac.starlink.topcat.BitsRowSubset

public class BitsRowSubset
extends RowSubset

A RowSubset which maintains the inclusion status of each row as a separate flag.

Author:
Mark Taylor (Starlink)

Field Summary
 
Fields inherited from class uk.ac.starlink.topcat.RowSubset
ALL, NONE
 
Constructor Summary
BitsRowSubset(String name, BitSet bits)
          Constructs a new row subset with a given BitSet and name.
BitsRowSubset(String name, BitSet bits, boolean invert)
          Constructs a new row subset with a given BitSet, name and sense.
 
Method Summary
 BitSet getBitSet()
          Returns the BitSet object used to store the inclusion status flags.
 boolean getInvert()
          Returns the inversion sense of the inclusion flags represented by this subset relative to the bit set.
 boolean isIncluded(long lrow)
          Indicates whether a given row is in the subset or not.
 
Methods inherited from class uk.ac.starlink.topcat.RowSubset
getName, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitsRowSubset

public BitsRowSubset(String name,
                     BitSet bits,
                     boolean invert)
Constructs a new row subset with a given BitSet, name and sense. The invert argument indicates whether the sense of the bit set is to be reversed prior to interpretation.

Parameters:
name - subset name
bits - flag vector
invert - whether to invert the bits from the BitSet

BitsRowSubset

public BitsRowSubset(String name,
                     BitSet bits)
Constructs a new row subset with a given BitSet and name. Same as BitsRowSubset(name,bits,false)

Parameters:
name - subset name
bits - flag vector
Method Detail

getBitSet

public BitSet getBitSet()
Returns the BitSet object used to store the inclusion status flags.

Returns:
flag vector

getInvert

public boolean getInvert()
Returns the inversion sense of the inclusion flags represented by this subset relative to the bit set.

Returns:
true iff bitset bits are inverted to give inclusion flag

isIncluded

public boolean isIncluded(long lrow)
Description copied from class: RowSubset
Indicates whether a given row is in the subset or not.

Specified by:
isIncluded in class RowSubset
Parameters:
lrow - the index of the row in question
Returns:
true iff row lrow is to be included


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.