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.Strand
The negative strand is represented by the symbol '-' and has the number -1.static final RichLocation.Strand
The positive strand is represented by the symbol '+' and has the number 1.static final RichLocation.Strand
The unknown strand is represented by the symbol '?' -
Method Summary
Modifier and TypeMethodDescriptionint
Strands are compared first by symbol, then by number.boolean
Strands are equal if their numbers and symbols match.static RichLocation.Strand
Returns the strand object that matches the symbol given.static RichLocation.Strand
forValue
(int value) Returns the strand object that matches the number given.getName()
Returns the string symbol of this strand.int
hashCode()
int
intValue()
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:
compareTo
in interfaceComparable
-