com.legstar.coxb.util
Class PictureUtil

java.lang.Object
  extended by com.legstar.coxb.util.PictureUtil

public final class PictureUtil
extends Object

These are methods to help analyze a COBOL picture clause.


Method Summary
static int getNumericInParentheses(String input)
          For a character sequence such as (nnn), this will extract the numeric value between parentheses.
static int getSymbolsNumber(char[] symbols, String input)
          Examines the input for the requested symbols (case insensitive) and returns the number of symbols found.
static int getSymbolsNumber(char symbol, String input)
          Examines the input for the requested symbol (case insensitive) and returns the number of symbols found.
static String preparePicture(String input)
          In order to simply parsing of picture clauses, this gets rid of any white space (which is illegal in picture clause anyway) and turns the sequence to uppercase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

preparePicture

public static String preparePicture(String input)
In order to simply parsing of picture clauses, this gets rid of any white space (which is illegal in picture clause anyway) and turns the sequence to uppercase.

Parameters:
input - the picture clause before
Returns:
the picture clause after

getSymbolsNumber

public static int getSymbolsNumber(char symbol,
                                   String input)
Examines the input for the requested symbol (case insensitive) and returns the number of symbols found. Symbols can appear individually (XXX) or have multipliers between parentheses (X(nn)).

Parameters:
symbol - the symbol to look up
input - the character sequence
Returns:
the number of symbols found

getSymbolsNumber

public static int getSymbolsNumber(char[] symbols,
                                   String input)
Examines the input for the requested symbols (case insensitive) and returns the number of symbols found. Symbols can appear individually (XXX) or have multipliers between parentheses (X(nn)).

Parameters:
symbols - the collection of symbols to look up
input - the character sequence
Returns:
the number of symbols found

getNumericInParentheses

public static int getNumericInParentheses(String input)
For a character sequence such as (nnn), this will extract the numeric value between parentheses.

Parameters:
input - starts with open parentheses
Returns:
the numeric value between parentheses


Copyright © 2015 LegSem. All Rights Reserved.