CESE 1.4.7

com.simulogic.dataview.analysis
Class SweepTokenizer

java.lang.Object
  extended by com.simulogic.dataview.analysis.SweepTokenizer

public class SweepTokenizer
extends java.lang.Object

This class can format a list of selected indices (typically from the JList) into the string

or parse a sweep selection string into the list of indices.


Constructor Summary
SweepTokenizer()
           
 
Method Summary
static java.lang.String parseSelection(int[] indices)
          Transforms the list of selected sweep indices into the string containing sweep numbers
static int[] parseSweeps(java.lang.String s)
          Parses the string containing sweep numbers into the list of indices to be selected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SweepTokenizer

public SweepTokenizer()
Method Detail

parseSweeps

public static final int[] parseSweeps(java.lang.String s)
                               throws java.lang.NumberFormatException
Parses the string containing sweep numbers into the list of indices to be selected

Comma (",") separates sweep numbers and double dot ("..") sets interval to be selected (both limits are included into the selection)

Parameters:
s - string to be parsed
Returns:
int[] array of selected sweep indices
Throws:
java.lang.NumberFormatException - if string can not be correctly parsed

parseSelection

public static final java.lang.String parseSelection(int[] indices)
Transforms the list of selected sweep indices into the string containing sweep numbers

If the list contains 3 and more adjunct indices (e.g. 5,6,7..), they will be converted into the interval form (5..7); otherwise, comma will be used to separate sweep numbers

Parameters:
indices - array of indices to process
Returns:
String resulting string containing sweep numbers in the aforementioned form

CESE 1.4.7

Copyright (c) 1999 - 2007 Cell Electrophysiology Simulation Environment (CESE). All rights reserved.