Package org.biojavax.bio.seq
Class RichLocation.Strand
java.lang.Object
org.biojavax.bio.seq.RichLocation.Strand
- All Implemented Interfaces:
Comparable
- Enclosing interface:
- RichLocation
This class represents a strand on which a location may lie. Three strands
are defined by default - UNKNOWN, NEGATIVE, and POSITIVE.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RichLocation.StrandThe negative strand is represented by the symbol '-' and has the number -1.static final RichLocation.StrandThe positive strand is represented by the symbol '+' and has the number 1.static final RichLocation.StrandThe unknown strand is represented by the symbol '?' -
Method Summary
Modifier and TypeMethodDescriptionintStrands are compared first by symbol, then by number.booleanStrands are equal if their numbers and symbols match.static RichLocation.StrandReturns the strand object that matches the symbol given.static RichLocation.StrandforValue(int value) Returns the strand object that matches the number given.getName()Returns the string symbol of this strand.inthashCode()intintValue()Returns the numeric value of this strand.toString()Form: "symbol" (eg. +,-,?)
-
Field Details
-
POSITIVE_STRAND
The positive strand is represented by the symbol '+' and has the number 1. -
NEGATIVE_STRAND
The negative strand is represented by the symbol '-' and has the number -1. -
UNKNOWN_STRAND
The unknown strand is represented by the symbol '?' and has the number 0.
-
-
Method Details
-
forValue
Returns the strand object that matches the number given. Throws an exception if it could not recognise the number. Number is usually 1,-1,0.- Parameters:
value- the number of the strand.- Returns:
- the strand matching that number.
-
forName
Returns the strand object that matches the symbol given. Throws an exception if it could not recognise the symbol. Symbol is usually +,-,?.- Parameters:
name- the symbol of the strand.- Returns:
- the strand matching that symbol.
-
intValue
Returns the numeric value of this strand.- Returns:
- the numeric value.
-
getName
Returns the string symbol of this strand.- Returns:
- the string symbol.
-
toString
Form: "symbol" (eg. +,-,?) -
hashCode
-
equals
Strands are equal if their numbers and symbols match. -
compareTo
Strands are compared first by symbol, then by number.- Specified by:
compareToin interfaceComparable
-