## org.biojava.bio.seq.projection
Class TranslateFlipContext

    java.lang.Object
      org.biojava.bio.seq.projection.ReparentContext
          org.biojava.bio.seq.projection.TranslateFlipContext

All Implemented Interfaces:
  Serializable, ProjectionContext

    public class TranslateFlipContext

extends ReparentContext

A ProjectionContext that translates and optionaly flips features.

Use this to 'reverse complement' a feature hierachy, or just to shift it sideways a bit.

If the flipping mode is dissabled, then all translated features are projected as having locations equivalent to feat.getLocation().translate(translation). If the flipping mode is enabled, then all features are flipped arround translation so that translation-i becomes translation+i.

Author:
  Matthew Pocock
See Also:
  Serialized Form

Constructor Summary
`TranslateFlipContext(FeatureHolder parent, FeatureHolder wrapped, int translation)` Create a new TranslateFlipContext with translation only.
`TranslateFlipContext(FeatureHolder parent, FeatureHolder wrapped, int translate, boolean oppositeStrand)` Create a new TranslateFlipContext with explicit translation and flip.
`TranslateFlipContext(FeatureHolder parent, FeatureHolder wrapped, int min, int max)` Create a new TranslateFlipContext that flips all featurs arround min and max.

Method Summary
`protected FilterUtils.FilterTransformer` `getReverter()`
`protected FilterUtils.FilterTransformer` `getTransformer()`
`int` `getTranslation()`
`boolean` `isOppositeStrand()`
`Location` `projectLocation(Location oldLoc)`
`StrandedFeature.Strand` `projectStrand(StrandedFeature.Strand strand)`
`Location` `revertLocation(Location oldLoc)`
`StrandedFeature.Strand` `revertStrand(StrandedFeature.Strand strand)`

Methods inherited from class org.biojava.bio.seq.projection.ReparentContext
`addChangeListener, createFeature, createFeature, getParent, getParent, getSchema, getSequence, getUnprojectedFeatures, projectChildFeatures, projectFeature, projectFeatures, projectFilter, removeChangeListener, removeFeature, removeFeature, revertFeature, revertFilter`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TranslateFlipContext

    public TranslateFlipContext(FeatureHolder parent,
                                FeatureHolder wrapped,
                                int translate,
                                boolean oppositeStrand)

  Create a new TranslateFlipContext with explicit translation and flip.

  Locations will be mapped according to the rules in @link ProjectionUtils.

  Parameters:
    `parent` - the parent to graft all projected features onto
    `wrapped` - the featurs to project
    `translate` - the translation
    `oppositeStrand` - wether or not to flip

### TranslateFlipContext

    public TranslateFlipContext(FeatureHolder parent,
                                FeatureHolder wrapped,
                                int min,
                                int max)

  Create a new TranslateFlipContext that flips all featurs arround min and max.

  A Location at exactly min will become one at max, and a Location at exactly max will become one at min.

  This is equivalent to `TranslateFlipContext(parent, wrapped, min + max, true)` and is provided to make client code more readable.

  Parameters:
    `parent` - the parent to graft all projected features ont
    `wrapped` - the features to project
    `min` - the lower position
    `max` - the higher position

### TranslateFlipContext

    public TranslateFlipContext(FeatureHolder parent,
                                FeatureHolder wrapped,
                                int translation)

  Create a new TranslateFlipContext with translation only.

  This is equivalent to `TranslateFlipContext(parent, wrapped, translation, false)` and is provided to make client code more readable.

  Parameters:
    `parent` - the parent to graft all projected features onto
    `wrapped` - the featurs to project
    `translation` - the translation

Method Detail

### getTranslation

    public final int getTranslation()

### isOppositeStrand

    public final boolean isOppositeStrand()

### projectLocation

    public Location projectLocation(Location oldLoc)

### revertLocation

    public final Location revertLocation(Location oldLoc)

### projectStrand

    public final StrandedFeature.Strand projectStrand(StrandedFeature.Strand strand)

### revertStrand

    public final StrandedFeature.Strand revertStrand(StrandedFeature.Strand strand)

### getTransformer

    protected FilterUtils.FilterTransformer getTransformer()

  Overrides:
    `getTransformer` in class `ReparentContext`

### getReverter

    protected FilterUtils.FilterTransformer getReverter()

  Overrides:
    `getReverter` in class `ReparentContext`