edu.upenn.gloDB.gui
Class QueryElement

java.lang.Object
  extended by edu.upenn.gloDB.gui.QueryElement
All Implemented Interfaces:
java.lang.Cloneable

public class QueryElement
extends java.lang.Object
implements java.lang.Cloneable

Contains query info for either a single Track or a group of QueryElements (ie Tracks).

Version:
$Id: QueryElement.java,v 1.1.2.19 2007/03/01 21:17:33 fisher Exp $

Field Summary
private  java.util.ArrayList group
          Group of QueryElements (ie Tracks).
private  int maxLength
          Maximum acceptible Feature width.
private  int maxPos
          Maximum ordered position ('POS').
private  int maxRepeat
          Maximum number of repeating features.
private  int maxSeqPos
          Maximum acceptible position within 'sequence'.
private  int maxWithin
          Maximum number of positions between repeating features.
private  int minLength
          Minimum acceptible Feature width.
private  int minPos
          Minimum ordered position ('POS').
private  int minRepeat
          Minimum number of repeating features.
private  int minSeqPos
          Minimum acceptible position within 'sequence'.
private  int minWithin
          Minimum number of positions between repeating features.
 boolean negate
          Negate?
 int operator
          Index for type of operation to be performed.
static java.lang.String[] OPERATORS
           
 java.lang.String sequence
          Sequence ID.
 java.lang.String track
          Track ID.
 
Constructor Summary
QueryElement()
          Create a new QueryElement object.
QueryElement(java.lang.String track)
          Create a new QueryElement object.
 
Method Summary
 void addToGroup(java.lang.Object element)
          'element' is assumed to be a QueryElement.
 java.lang.Object clone()
          Create a shallow clone (just clone the structure, not the Objects) of the existing object.
 java.util.ArrayList getGroup()
           
 java.lang.String getMaxLength()
           
 java.lang.String getMaxPos()
           
 java.lang.String getMaxRepeat()
           
 java.lang.String getMaxSeqPos()
           
 java.lang.String getMaxWithin()
           
 java.lang.String getMinLength()
          Most often need these as Strings
 java.lang.String getMinPos()
           
 java.lang.String getMinRepeat()
           
 java.lang.String getMinSeqPos()
           
 java.lang.String getMinWithin()
           
 java.lang.String getOperatorVal()
          Returns the string equivalent to the operator index value.
static java.lang.String getOperatorVal(int index)
          Returns the string equivalent to the operator index value.
 java.util.Iterator groupIterator()
           
 int groupSize()
           
 boolean isGrouped()
           
static boolean isOrderOperator(int index)
          Returns the string equivalent to the operator index value.
static boolean isOrderOperator(java.lang.String operator)
          Returns the string equivalent to the operator index value.
 void setGroup(java.util.ArrayList group)
          If null value, then will set group to a new ArrayList().
 void setMaxLength(java.lang.String val)
           
 void setMaxPos(java.lang.String val)
           
 void setMaxRepeat(java.lang.String val)
           
 void setMaxSeqPos(java.lang.String val)
           
 void setMaxWithin(java.lang.String val)
           
 void setMinLength(java.lang.String val)
           
 void setMinPos(java.lang.String val)
           
 void setMinRepeat(java.lang.String val)
           
 void setMinSeqPos(java.lang.String val)
           
 void setMinWithin(java.lang.String val)
           
 java.lang.Object[] toArray()
          Creates an array with the fields in the following order: "operator, negate, group, track, sequence, min/max length, min/max pos".
 java.lang.String toString()
          Returns QueryElement information for debugging purposes.
 java.lang.String toStringQualifiers()
          Returns a String that contains the qualifiers (Sequence, Length, and SeqPos) formatted for a query.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPERATORS

public static final java.lang.String[] OPERATORS

group

private java.util.ArrayList group
Group of QueryElements (ie Tracks).


track

public java.lang.String track
Track ID.


operator

public int operator
Index for type of operation to be performed. The string values are stored in OPERATORS.


negate

public boolean negate
Negate?


sequence

public java.lang.String sequence
Sequence ID.


minLength

private int minLength
Minimum acceptible Feature width.


maxLength

private int maxLength
Maximum acceptible Feature width.


minSeqPos

private int minSeqPos
Minimum acceptible position within 'sequence'.


maxSeqPos

private int maxSeqPos
Maximum acceptible position within 'sequence'. If -1, then goes to maximum Sequence length.


minPos

private int minPos
Minimum ordered position ('POS').


maxPos

private int maxPos
Maximum ordered position ('POS').


minRepeat

private int minRepeat
Minimum number of repeating features.

Notes:
Default = '1'

maxRepeat

private int maxRepeat
Maximum number of repeating features.

Notes:
Default = '1'

minWithin

private int minWithin
Minimum number of positions between repeating features. If '0', then any overlap between features will be valid.

Notes:
Default = '0'

maxWithin

private int maxWithin
Maximum number of positions between repeating features.

Notes:
Default = '0'
Constructor Detail

QueryElement

public QueryElement()
Create a new QueryElement object.


QueryElement

public QueryElement(java.lang.String track)
Create a new QueryElement object.

Method Detail

getGroup

public java.util.ArrayList getGroup()

setGroup

public void setGroup(java.util.ArrayList group)
If null value, then will set group to a new ArrayList().


setMinLength

public void setMinLength(java.lang.String val)

setMaxLength

public void setMaxLength(java.lang.String val)

setMinSeqPos

public void setMinSeqPos(java.lang.String val)

setMaxSeqPos

public void setMaxSeqPos(java.lang.String val)

setMinRepeat

public void setMinRepeat(java.lang.String val)

setMaxRepeat

public void setMaxRepeat(java.lang.String val)

setMinWithin

public void setMinWithin(java.lang.String val)

setMaxWithin

public void setMaxWithin(java.lang.String val)

setMinPos

public void setMinPos(java.lang.String val)

setMaxPos

public void setMaxPos(java.lang.String val)

getMinLength

public java.lang.String getMinLength()
Most often need these as Strings


getMaxLength

public java.lang.String getMaxLength()

getMinSeqPos

public java.lang.String getMinSeqPos()

getMaxSeqPos

public java.lang.String getMaxSeqPos()

getMinRepeat

public java.lang.String getMinRepeat()

getMaxRepeat

public java.lang.String getMaxRepeat()

getMinWithin

public java.lang.String getMinWithin()

getMaxWithin

public java.lang.String getMaxWithin()

getMinPos

public java.lang.String getMinPos()

getMaxPos

public java.lang.String getMaxPos()

getOperatorVal

public static java.lang.String getOperatorVal(int index)
Returns the string equivalent to the operator index value.


isOrderOperator

public static boolean isOrderOperator(int index)
Returns the string equivalent to the operator index value.


isOrderOperator

public static boolean isOrderOperator(java.lang.String operator)
Returns the string equivalent to the operator index value.


getOperatorVal

public java.lang.String getOperatorVal()
Returns the string equivalent to the operator index value.


addToGroup

public void addToGroup(java.lang.Object element)
'element' is assumed to be a QueryElement.


isGrouped

public boolean isGrouped()

groupSize

public int groupSize()

groupIterator

public java.util.Iterator groupIterator()

clone

public java.lang.Object clone()
Create a shallow clone (just clone the structure, not the Objects) of the existing object.

Overrides:
clone in class java.lang.Object

toArray

public java.lang.Object[] toArray()
Creates an array with the fields in the following order: "operator, negate, group, track, sequence, min/max length, min/max pos".


toStringQualifiers

public java.lang.String toStringQualifiers()
Returns a String that contains the qualifiers (Sequence, Length, and SeqPos) formatted for a query.


toString

public java.lang.String toString()
Returns QueryElement information for debugging purposes.

Overrides:
toString in class java.lang.Object



Copyright 2012 Stephen Fisher and Junhyong Kim, University of Pennsylvania. All Rights Reserved.