mondrian.rolap
Class BitKey.Small

java.lang.Object
  extended by mondrian.rolap.BitKey.AbstractBitKey
      extended by mondrian.rolap.BitKey.Small
All Implemented Interfaces:
Comparable<BitKey>, Iterable<Integer>, BitKey
Enclosing interface:
BitKey

public static class BitKey.Small
extends BitKey.AbstractBitKey

Implementation of BitKey for bit counts less than 64.

 

Nested Class Summary
 
Nested classes/interfaces inherited from interface mondrian.rolap.BitKey
BitKey.AbstractBitKey, BitKey.Big, BitKey.Factory, BitKey.Mid128, BitKey.Small
 
Field Summary
 
Fields inherited from class mondrian.rolap.BitKey.AbstractBitKey
ChunkBitCount, Mask
 
Fields inherited from interface mondrian.rolap.BitKey
bitPositionTable
 
Method Summary
 BitKey and(BitKey bitKey)
          Returns the boolean AND of this bitkey and the given bitkey.
 BitKey andNot(BitKey bitKey)
          Returns a BitKey containing all of the bits in this BitSet whose corresponding bit is NOT set in the specified BitSet.
 void clear()
          Sets all of the bits in this BitKey to false.
 void clear(int pos)
          Sets the bit specified by the index to false.
 int compareTo(BitKey bitKey)
           
 BitKey copy()
          Returns a copy of this BitKey.
 BitKey emptyCopy()
          Returns an empty BitKey of the same type.
 boolean equals(Object o)
           
 boolean get(int pos)
          Returns the value of the bit with the specified index.
 int hashCode()
           
 boolean intersects(BitKey bitKey)
          Returns whether this BitKey has any bits in common with a given BitKey.
 boolean isEmpty()
          Returns true if this BitKey contains no bits that are set to true.
 boolean isSuperSetOf(BitKey bitKey)
          Is every bit set in the parameter bitKey also set in this.
 Iterator<Integer> iterator()
          To say that I am happy about this algorithm (or the variations of the algorithm used for the Mid128 and Big BitKey implementations) would be a stretch.
 BitKey or(BitKey bitKey)
          Or the parameter BitKey with this.
 void set(int pos)
          Sets the bit at the specified index to true.
 BitSet toBitSet()
          Returns a BitSet with the same contents as this BitKey.
 String toString()
           
 
Methods inherited from class mondrian.rolap.BitKey.AbstractBitKey
bit, chunkCount, chunkPos, copyFromByte, copyFromLong, createException, set
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

set

public void set(int pos)
Description copied from interface: BitKey
Sets the bit at the specified index to true.


get

public boolean get(int pos)
Description copied from interface: BitKey
Returns the value of the bit with the specified index. The value is true if the bit with the index bitIndex is currently set in this BitKey; otherwise, the result is false.


clear

public void clear(int pos)
Description copied from interface: BitKey
Sets the bit specified by the index to false.


clear

public void clear()
Description copied from interface: BitKey
Sets all of the bits in this BitKey to false.


or

public BitKey or(BitKey bitKey)
Description copied from interface: BitKey
Or the parameter BitKey with this.


and

public BitKey and(BitKey bitKey)
Description copied from interface: BitKey
Returns the boolean AND of this bitkey and the given bitkey.


andNot

public BitKey andNot(BitKey bitKey)
Description copied from interface: BitKey
Returns a BitKey containing all of the bits in this BitSet whose corresponding bit is NOT set in the specified BitSet.


isSuperSetOf

public boolean isSuperSetOf(BitKey bitKey)
Description copied from interface: BitKey
Is every bit set in the parameter bitKey also set in this. If one switches this with the parameter bitKey one gets the equivalent of isSubSetOf.


intersects

public boolean intersects(BitKey bitKey)
Description copied from interface: BitKey
Returns whether this BitKey has any bits in common with a given BitKey.


toBitSet

public BitSet toBitSet()
Description copied from interface: BitKey
Returns a BitSet with the same contents as this BitKey.


iterator

public Iterator<Integer> iterator()
To say that I am happy about this algorithm (or the variations of the algorithm used for the Mid128 and Big BitKey implementations) would be a stretch. It works but there has to be a more elegant and faster one but this is the best I could come up with in a couple of hours.


equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(BitKey bitKey)

toString

public String toString()
Overrides:
toString in class Object

copy

public BitKey copy()
Description copied from interface: BitKey
Returns a copy of this BitKey.

Returns:
copy of BitKey

emptyCopy

public BitKey emptyCopy()
Description copied from interface: BitKey
Returns an empty BitKey of the same type. This is the same as calling BitKey.copy() followed by BitKey.clear().

Returns:
BitKey of same type

isEmpty

public boolean isEmpty()
Description copied from interface: BitKey
Returns true if this BitKey contains no bits that are set to true.


SourceForge.net_Logo