net.sourceforge.cilib.bioinf.rnaprediction
Class RNAStem

java.lang.Object
  extended by net.sourceforge.cilib.bioinf.rnaprediction.RNAStem
All Implemented Interfaces:
Serializable, Comparable<RNAStem>, Iterable<NucleotidePair>, Collection<NucleotidePair>, Type, Cloneable

public class RNAStem
extends Object
implements Type, Comparable<RNAStem>, Collection<NucleotidePair>

Author:
mneethling
See Also:
Serialized Form

Constructor Summary
RNAStem()
           
RNAStem(ArrayList<NucleotidePair> basePairs)
           
 
Method Summary
 boolean add(NucleotidePair o)
           
 boolean addAll(Collection<? extends NucleotidePair> c)
           
 void clear()
           
 int compareTo(RNAStem o)
           
 boolean conflictsWith(RNAStem otherstem)
          Uses the StemConflictTable Singleton class to look up conflicts quicker.
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 boolean equals(Object other)
          Compare the specified object with this type for equality.
 RNAStem getClone()
          Create a cloned copy of the current object and return it.
 ArrayList<RNAStem> getConflictingStems()
           
 int getId()
           
 int getIndex()
           
 int getLength()
           
 int hashCode()
          Returns the hash code value for this list.
 boolean isEmpty()
           
 Iterator<NucleotidePair> iterator()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 void setConflictingStems(ArrayList<RNAStem> conflicts)
           
 void setIndex(int index)
           
 int size()
           
 boolean slowConflictsWith(RNAStem otherstem)
          returns true if the stems fail all of four tests.
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RNAStem

public RNAStem()

RNAStem

public RNAStem(ArrayList<NucleotidePair> basePairs)
Method Detail

getId

public int getId()

getIndex

public int getIndex()
Returns:
Returns the index.

setIndex

public void setIndex(int index)
Parameters:
index - The index to set.

equals

public boolean equals(Object other)
Description copied from interface: Type
Compare the specified object with this type for equality. Returns true if and only if the specified object is also an instance of the same type.

Specified by:
equals in interface Collection<NucleotidePair>
Specified by:
equals in interface Type
Overrides:
equals in class Object
Parameters:
other - The object to compare.
Returns:
true if equality exists, false otherwise.
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Description copied from interface: Type
Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:
  int hashCode = 7;
  Iterator<E> i = list.iterator();
  while (i.hasNext()) {
      E obj = i.next();
      hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
  }
 
This ensures that type1.equals(type2) implies that type1.hashCode()==type2.hashCode() for any two types, type1 and type2, as required by the general contract of Object.hashCode().

Specified by:
hashCode in interface Collection<NucleotidePair>
Specified by:
hashCode in interface Type
Overrides:
hashCode in class Object
Returns:
the hash code value for this list
See Also:
Object.equals(Object), Type.equals(Object)

getLength

public int getLength()

size

public int size()
Specified by:
size in interface Collection<NucleotidePair>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<NucleotidePair>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<NucleotidePair>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<NucleotidePair>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<NucleotidePair>

clear

public void clear()
Specified by:
clear in interface Collection<NucleotidePair>

conflictsWith

public boolean conflictsWith(RNAStem otherstem)
Uses the StemConflictTable Singleton class to look up conflicts quicker.

Parameters:
otherstem -
Returns:

slowConflictsWith

public boolean slowConflictsWith(RNAStem otherstem)
returns true if the stems fail all of four tests.

Parameters:
stem -
Returns:

add

public boolean add(NucleotidePair o)
Specified by:
add in interface Collection<NucleotidePair>

compareTo

public int compareTo(RNAStem o)
Specified by:
compareTo in interface Comparable<RNAStem>

addAll

public boolean addAll(Collection<? extends NucleotidePair> c)
Specified by:
addAll in interface Collection<NucleotidePair>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<NucleotidePair>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<NucleotidePair>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<NucleotidePair>

iterator

public Iterator<NucleotidePair> iterator()
Specified by:
iterator in interface Iterable<NucleotidePair>
Specified by:
iterator in interface Collection<NucleotidePair>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<NucleotidePair>

setConflictingStems

public void setConflictingStems(ArrayList<RNAStem> conflicts)

getConflictingStems

public ArrayList<RNAStem> getConflictingStems()

getClone

public RNAStem getClone()
Description copied from interface: Type
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Type
Specified by:
getClone in interface Cloneable
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 CIRG. All Rights Reserved.