Package org.biojavax.bio.seq
Class RichLocation.Strand
- java.lang.Object
-
- org.biojavax.bio.seq.RichLocation.Strand
-
- All Implemented Interfaces:
java.lang.Comparable
- Enclosing interface:
- RichLocation
public static class RichLocation.Strand extends java.lang.Object implements java.lang.ComparableThis class represents a strand on which a location may lie. Three strands are defined by default - UNKNOWN, NEGATIVE, and POSITIVE.
-
-
Field Summary
Fields Modifier and Type Field Description static RichLocation.StrandNEGATIVE_STRANDThe negative strand is represented by the symbol '-' and has the number -1.static RichLocation.StrandPOSITIVE_STRANDThe positive strand is represented by the symbol '+' and has the number 1.static RichLocation.StrandUNKNOWN_STRANDThe unknown strand is represented by the symbol '?' and has the number 0.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object o)Strands are compared first by symbol, then by number.booleanequals(java.lang.Object o)Strands are equal if their numbers and symbols match.static RichLocation.StrandforName(java.lang.String name)Returns the strand object that matches the symbol given.static RichLocation.StrandforValue(int value)Returns the strand object that matches the number given.java.lang.StringgetName()Returns the string symbol of this strand.inthashCode()intintValue()Returns the numeric value of this strand.java.lang.StringtoString()Form: "symbol" (eg.
-
-
-
Field Detail
-
POSITIVE_STRAND
public static final RichLocation.Strand POSITIVE_STRAND
The positive strand is represented by the symbol '+' and has the number 1.
-
NEGATIVE_STRAND
public static final RichLocation.Strand NEGATIVE_STRAND
The negative strand is represented by the symbol '-' and has the number -1.
-
UNKNOWN_STRAND
public static final RichLocation.Strand UNKNOWN_STRAND
The unknown strand is represented by the symbol '?' and has the number 0.
-
-
Method Detail
-
forValue
public static RichLocation.Strand forValue(int value)
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
public static RichLocation.Strand forName(java.lang.String name)
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
public int intValue()
Returns the numeric value of this strand.- Returns:
- the numeric value.
-
getName
public java.lang.String getName()
Returns the string symbol of this strand.- Returns:
- the string symbol.
-
toString
public java.lang.String toString()
Form: "symbol" (eg. +,-,?)- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Strands are equal if their numbers and symbols match.- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object o)
Strands are compared first by symbol, then by number.- Specified by:
compareToin interfacejava.lang.Comparable
-
-