edu.unh.sdb.datasource
Class ISIDMapper

java.lang.Object
  extended by edu.unh.sdb.datasource.ISIDMapper

public class ISIDMapper
extends java.lang.Object

This class is used for mapping IndexSpaceIDs and ISBounds to/from ISBounds defined within component and composite spaces.


Constructor Summary
ISIDMapper(ISBounds bounds)
          Create an ISIDMapper which does identity mapping.
ISIDMapper(ISBounds componentSubset, ISBounds compositeExtent)
          Create an ISIDMapper.
 
Method Summary
 boolean contains(IndexSpaceID id)
          Check if the given IndexSpaceID is contained by this component
 boolean equals(ISIDMapper mapper2)
          Return true if two ISIDMapper equal
 ISBounds getComponentSubset()
          Return a copy of the Component Subset bounds
 ISBounds getCompositeExtent()
          Return a copy of the Composite Extent bounds
 boolean isIdentityMapper()
          Return true if this ISIDMapper is an identity mapper
static void main(java.lang.String[] args)
          For debugging.
 IndexSpaceID toComponent(IndexSpaceID compositeID)
          Map the IndexSpaceID argument from composite space to component space.
 IndexSpaceID toComponent(IndexSpaceID componentID, IndexSpaceID compositeID)
          Map the IndexSpaceID argument from composite space to component space.
 int[] toComponent(int[] compositeCoords)
          Map the coords array argument from composite space to component space.
 int[] toComponent(int[] componentCoords, int[] compositeCoords)
          Map the coords array argument from composite space to component space.
 ISBounds toComponent(ISBounds compositeBounds)
          Map the bounds argument from composite space to component space.
 IndexSpaceID toComposite(IndexSpaceID componentID)
          Map the IndexSpaceID argument from component space to composite space.
 int[] toComposite(int[] componentCoords)
          Map the coords array argument from component space to composite space.
 ISBounds toComposite(ISBounds componentBounds)
          Map the bounds argument from component space to composite space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISIDMapper

public ISIDMapper(ISBounds componentSubset,
                  ISBounds compositeExtent)
Create an ISIDMapper. The first argument specifies the subset of the component space that will be mapped to a region in the composite space. The second argument specifies the extent of this region in the composite space.


ISIDMapper

public ISIDMapper(ISBounds bounds)
Create an ISIDMapper which does identity mapping.

Method Detail

toComposite

public IndexSpaceID toComposite(IndexSpaceID componentID)
Map the IndexSpaceID argument from component space to composite space.


toComposite

public int[] toComposite(int[] componentCoords)
Map the coords array argument from component space to composite space.


toComposite

public ISBounds toComposite(ISBounds componentBounds)
Map the bounds argument from component space to composite space.


toComponent

public final IndexSpaceID toComponent(IndexSpaceID compositeID)
Map the IndexSpaceID argument from composite space to component space.


toComponent

public IndexSpaceID toComponent(IndexSpaceID componentID,
                                IndexSpaceID compositeID)
Map the IndexSpaceID argument from composite space to component space.


toComponent

public final int[] toComponent(int[] compositeCoords)
Map the coords array argument from composite space to component space.


toComponent

public int[] toComponent(int[] componentCoords,
                         int[] compositeCoords)
Map the coords array argument from composite space to component space. Pass in the variable to be returned with component location. If the first argument is not null and is of the right dimension, it will be filled and returned. Otherwise, a new array will be allocated, filled and returned.


toComponent

public ISBounds toComponent(ISBounds compositeBounds)
Map the bounds argument from composite space to component space.


getCompositeExtent

public ISBounds getCompositeExtent()
Return a copy of the Composite Extent bounds


getComponentSubset

public ISBounds getComponentSubset()
Return a copy of the Component Subset bounds


isIdentityMapper

public boolean isIdentityMapper()
Return true if this ISIDMapper is an identity mapper


contains

public boolean contains(IndexSpaceID id)
Check if the given IndexSpaceID is contained by this component


equals

public boolean equals(ISIDMapper mapper2)
Return true if two ISIDMapper equal


main

public static void main(java.lang.String[] args)
For debugging. Runs basic tests on the ISIDMapper class.