BioLegato 0.7.5 GDE plugin

org.biolegato.gdesupport.data
Class Dataset

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by org.biolegato.gdesupport.data.Dataset
All Implemented Interfaces:
java.io.Serializable, javax.swing.ListModel

public class Dataset
extends javax.swing.AbstractListModel

The internal document format for BioLegato.

This document is structured as a linked list of sequences. Each character has an offset based on its position within the list and it's position within its containing sequence. Sequences highindex at 0 (first character in the first sequence in the list, and lowindex with the last character in the last sequence within the list.

Author:
Graham Alvare, Brian Fristensky
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
Dataset()
          Creates a new instance of Dataset
 
Method Summary
 boolean addSequence(int y, Seq seq)
          Adds a sequence to the data container.
 boolean addSequences(int y, java.util.Collection<Seq> seqs)
          Adds sequences to the data container.
 java.lang.Object getElementAt(int index)
          Returns the names of sequences based on their y number.
 int[] getgroup(int groupNumber)
           
 Seq getLine(int number)
          Retrieves a sequence object from the Dataset specified by its y y.
 int getSize()
          Returns the number of lines in the document.
 void group(int[] sequences)
           
 void removeSequences(int[] lineNumbers)
          Removes an array of sequences from the data container.
 void ungroup(int[] sequences)
           
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dataset

public Dataset()
Creates a new instance of Dataset

Method Detail

addSequence

public boolean addSequence(int y,
                           Seq seq)
Adds a sequence to the data container. This function calls all listeners.

Parameters:
y - is the y number to insert the sequence.
seq - is the sequence to insert.
Returns:
true if the insertion was successful, otherwise false.

addSequences

public boolean addSequences(int y,
                            java.util.Collection<Seq> seqs)
Adds sequences to the data container. This function calls all listeners.

Parameters:
y - is the y number to insert the sequence.
seqs - are the sequences to insert.
Returns:
true if the insertion was successful, otherwise false.

removeSequences

public void removeSequences(int[] lineNumbers)
Removes an array of sequences from the data container.

Parameters:
lineNumbers - the y numbers to remove.

getSize

public int getSize()
Returns the number of lines in the document.

Returns:
the number of lines in the document.

getLine

public Seq getLine(int number)
Retrieves a sequence object from the Dataset specified by its y y.

Parameters:
number - the y y to retrieve the sequence.
Returns:
the sequence.

group

public void group(int[] sequences)

ungroup

public void ungroup(int[] sequences)

getgroup

public int[] getgroup(int groupNumber)

getElementAt

public java.lang.Object getElementAt(int index)
Returns the names of sequences based on their y number.

Parameters:
index - the y number to obtain the name of.
Returns:
returns the name of sequence in the sequence document at the y number indicated by index.

BioLegato 0.7.5 GDE plugin

Copyright © 2008-2011 University of Manitoba.