com.legstar.cobol.model
Class CobolDataItem

java.lang.Object
  extended by com.legstar.cobol.model.CobolDataItem

public class CobolDataItem
extends Object

Model of a COBOL data entry.


Nested Class Summary
static class CobolDataItem.DataEntryType
          These correspond to the 3 different formats for data entries.
static class CobolDataItem.Range
          Represents a range between two literals.
 
Constructor Summary
CobolDataItem()
          No argument constructor.
CobolDataItem(int levelNumber, String cobolName)
          Constructor used when the level number is known.
CobolDataItem(String cobolName)
          Constructor used when the level number will be determined at a later time.
 
Method Summary
 void addAscendingKey(String ascendingKey)
           
 void addConditionLiterals(String conditionLiteral)
           
 void addConditionRange(CobolDataItem.Range conditionRange)
           
 void addDescendingKey(String descendingKey)
           
 void addIndex(String index)
           
 List<String> getAscendingKeys()
           
 List<CobolDataItem> getChildren()
           
 String getCobolName()
           
 String getCobolUsage()
           
 List<String> getConditionLiterals()
           
 List<CobolDataItem.Range> getConditionRanges()
           
 CobolDataItem.DataEntryType getDataEntryType()
           
 String getDateFormat()
           
 String getDependingOn()
           
 List<String> getDescendingKeys()
           
 List<String> getIndexes()
           
 int getLevelNumber()
           
 int getMaxOccurs()
           
 int getMinOccurs()
           
 String getPicture()
           
 String getRedefines()
           
 String getRenamesSubject()
           
 CobolDataItem.Range getRenamesSubjectRange()
           
 int getSrceLine()
           
 CobolUsage.Usage getUsage()
           
 String getValue()
          Value is a COBOL value clause.
 boolean isArray()
          in COBOL arrays are either occurring items (normal arrays) or optional items (they occur no time or once).
 boolean isBlankWhenZero()
           
 boolean isCondition()
           
 boolean isDataDescription()
           
 boolean isExternal()
           
 boolean isGlobal()
           
 boolean isGroupUsageNational()
           
 boolean isJustifiedRight()
           
 boolean isRenames()
           
 boolean isSign()
           
 boolean isSignLeading()
           
 boolean isSignSeparate()
           
 boolean isStructure()
           
 boolean isSynchronized()
           
 boolean isVariableSizeArray()
           
 void setAscendingKeys(List<String> ascendingKeys)
           
 void setBlankWhenZero(boolean blankWhenZero)
           
 void setChildren(List<CobolDataItem> children)
           
 void setCobolName(String cobolName)
           
 void setCobolUsage(String cobolUsage)
          Set the Usage using the COBOL using string.
 void setConditionLiterals(List<String> conditionLiterals)
           
 void setConditionRanges(List<CobolDataItem.Range> conditionRanges)
           
 void setDateFormat(String dateFormat)
           
 void setDependingOn(String dependingOn)
           
 void setDescendingKeys(List<String> descendingKeys)
           
 void setExternal(boolean external)
           
 void setGlobal(boolean global)
           
 void setGroupUsageNational(boolean groupUsageNational)
           
 void setIndexes(List<String> indexes)
           
 void setJustifiedRight(boolean justifiedRight)
           
 void setLevelNumber(int levelNumber)
           
 void setMaxOccurs(int maxOccurs)
           
 void setMinOccurs(int minOccurs)
           
 void setPicture(String picture)
           
 void setRedefines(String redefines)
           
 void setRenamesSubject(String renamesSubject)
           
 void setRenamesSubjectRange(CobolDataItem.Range renamesSubjectRange)
           
 void setSign(boolean isSign)
           
 void setSignLeading(boolean isSignLeading)
           
 void setSignSeparate(boolean isSignSeparate)
           
 void setSrceLine(int srceLine)
           
 void setSynchronized(boolean isSynchronized)
           
 void setUsage(CobolUsage.Usage usage)
           
 void setValue(String value)
          Value is a COBOL value clause.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CobolDataItem

public CobolDataItem()
No argument constructor.


CobolDataItem

public CobolDataItem(String cobolName)
Constructor used when the level number will be determined at a later time.

Parameters:
cobolName - the data item COBOL name

CobolDataItem

public CobolDataItem(int levelNumber,
                     String cobolName)
Constructor used when the level number is known.

Parameters:
levelNumber - the data item COBOL name
cobolName - the data item COBOL name
Method Detail

getLevelNumber

public int getLevelNumber()
Returns:
the Level in the hierarchy

setLevelNumber

public void setLevelNumber(int levelNumber)
Parameters:
levelNumber - the Level in the hierarchy to set

getCobolName

public String getCobolName()
Returns:
the Cobol element name

setCobolName

public void setCobolName(String cobolName)
Parameters:
cobolName - the Cobol element name to set

getRedefines

public String getRedefines()
Returns:
the Cobol element sharing same memory location

setRedefines

public void setRedefines(String redefines)
Parameters:
redefines - Cobol element sharing same memory location to set

isBlankWhenZero

public boolean isBlankWhenZero()
Returns:
the blank when zero clause

setBlankWhenZero

public void setBlankWhenZero(boolean blankWhenZero)
Parameters:
blankWhenZero - the blank when zero clause to set

isExternal

public boolean isExternal()
Returns:
the external clause

setExternal

public void setExternal(boolean external)
Parameters:
external - the external clause to set

isGlobal

public boolean isGlobal()
Returns:
the global clause

setGlobal

public void setGlobal(boolean global)
Parameters:
global - the global clause to set

isGroupUsageNational

public boolean isGroupUsageNational()
Returns:
the group usage national clause

setGroupUsageNational

public void setGroupUsageNational(boolean groupUsageNational)
Parameters:
groupUsageNational - the group usage national clause to set

isJustifiedRight

public boolean isJustifiedRight()
Returns:
true if String is right justified

setJustifiedRight

public void setJustifiedRight(boolean justifiedRight)
Parameters:
justifiedRight - true if String is right justified

getPicture

public String getPicture()
Returns:
the Cobol picture clause

setPicture

public void setPicture(String picture)
Parameters:
picture - the Cobol picture clause to set

isSign

public boolean isSign()
Returns:
true if COBOL data item has a SIGN clause

setSign

public void setSign(boolean isSign)
Parameters:
isSign - true if COBOL data item has a SIGN clause

isSignLeading

public boolean isSignLeading()
Returns:
true if sign clause specifies sign in leading byte (false means trailing byte)

setSignLeading

public void setSignLeading(boolean isSignLeading)
Parameters:
isSignLeading - true itrue if sign clause specifies sign in leading byte (false means trailing byte)

isSignSeparate

public boolean isSignSeparate()
Returns:
true if sign clause specifies sign in separate byte (overpunch)

setSignSeparate

public void setSignSeparate(boolean isSignSeparate)
Parameters:
isSignSeparate - true if sign clause specifies sign in separate byte (overpunch)

isSynchronized

public boolean isSynchronized()
Returns:
true if the item must be synchronized on natural boundary in storage

setSynchronized

public void setSynchronized(boolean isSynchronized)
Parameters:
isSynchronized - true if the item must be synchronized on natural boundary in storage

getMinOccurs

public int getMinOccurs()
Returns:
the minimum number of occurrences

setMinOccurs

public void setMinOccurs(int minOccurs)
Parameters:
minOccurs - the minimum number of occurrences to set

getMaxOccurs

public int getMaxOccurs()
Returns:
the maximum number of occurrences

setMaxOccurs

public void setMaxOccurs(int maxOccurs)
Parameters:
maxOccurs - the maximum number of occurrences to set

getDependingOn

public String getDependingOn()
Returns:
the Cobol element giving array actual size

setDependingOn

public void setDependingOn(String dependingOn)
Parameters:
dependingOn - the Cobol element giving array actual size to set

getIndexes

public List<String> getIndexes()
Returns:
the cobol indexed by sub-clauses

setIndexes

public void setIndexes(List<String> indexes)
Parameters:
indexes - the cobol indexed by sub-clauses to set

addIndex

public void addIndex(String index)
Parameters:
index - a cobol index to add

getAscendingKeys

public List<String> getAscendingKeys()
Returns:
the cobol ascending key is sub-clauses

setAscendingKeys

public void setAscendingKeys(List<String> ascendingKeys)
Parameters:
ascendingKeys - the cobol ascending key is sub-clauses to set

addAscendingKey

public void addAscendingKey(String ascendingKey)
Parameters:
ascendingKey - a cobol ascending key to add

getDescendingKeys

public List<String> getDescendingKeys()
Returns:
the cobol descending key is sub-clauses

setDescendingKeys

public void setDescendingKeys(List<String> descendingKeys)
Parameters:
descendingKeys - the cobol descending key is sub-clauses to set

addDescendingKey

public void addDescendingKey(String descendingKey)
Parameters:
descendingKey - a cobol descending key to add

getUsage

public CobolUsage.Usage getUsage()
Returns:
the Cobol usage clause (enum)

setUsage

public void setUsage(CobolUsage.Usage usage)
Parameters:
usage - the Cobol usage to set

getCobolUsage

public String getCobolUsage()
Returns:
the Cobol usage clause (as a COBOL string)

setCobolUsage

public void setCobolUsage(String cobolUsage)
Set the Usage using the COBOL using string.

Parameters:
cobolUsage - the COBOL usage string

getValue

public String getValue()
Value is a COBOL value clause. For string literals it must include start and end delimiters. Delimiters must be escaped in a COBOL acceptable way.

Returns:
the Cobol value clause

setValue

public void setValue(String value)
Value is a COBOL value clause. For string literals it must include start and end delimiters. Delimiters must be escaped in a COBOL acceptable way.

Parameters:
value - the Cobol values to set

getDateFormat

public String getDateFormat()
Returns:
the cobol date format clause

setDateFormat

public void setDateFormat(String dateFormat)
Parameters:
dateFormat - the cobol date format clause to set

getSrceLine

public int getSrceLine()
Returns:
the Line number in the original source file

setSrceLine

public void setSrceLine(int srceLine)
Parameters:
srceLine - the Line number in the original source file to set

getChildren

public List<CobolDataItem> getChildren()
Returns:
the ordered list of direct children

setChildren

public void setChildren(List<CobolDataItem> children)
Parameters:
children - the ordered list of direct children to set

isStructure

public boolean isStructure()
Returns:
true if this data item is a structure (group).

getRenamesSubject

public String getRenamesSubject()
Returns:
the single subject of a RENAMES clause

setRenamesSubject

public void setRenamesSubject(String renamesSubject)
Parameters:
renamesSubject - the single subject of a RENAMES clause to set

getRenamesSubjectRange

public CobolDataItem.Range getRenamesSubjectRange()
Returns:
the range of subjects of a RENAMES clause

setRenamesSubjectRange

public void setRenamesSubjectRange(CobolDataItem.Range renamesSubjectRange)
Parameters:
renamesSubjectRange - the range of subjects of a RENAMES clause to set

getConditionLiterals

public List<String> getConditionLiterals()
Returns:
the one or more literal values of a condition

setConditionLiterals

public void setConditionLiterals(List<String> conditionLiterals)
Parameters:
conditionLiterals - the one or more literal values of a condition to set

addConditionLiterals

public void addConditionLiterals(String conditionLiteral)
Parameters:
conditionLiteral - a literal value of a condition to set

getConditionRanges

public List<CobolDataItem.Range> getConditionRanges()
Returns:
the one or more ranges of literal values of a condition

setConditionRanges

public void setConditionRanges(List<CobolDataItem.Range> conditionRanges)
Parameters:
conditionRanges - the one or more ranges of literal values of a condition to set

addConditionRange

public void addConditionRange(CobolDataItem.Range conditionRange)
Parameters:
conditionRange - the range of literal values of a condition to set

getDataEntryType

public CobolDataItem.DataEntryType getDataEntryType()
Returns:
the data entry type inferred from the level

isCondition

public boolean isCondition()
Returns:
true if this is a condition (level 88)

isRenames

public boolean isRenames()
Returns:
true if this is a RENAMES clause (level 66)

isDataDescription

public boolean isDataDescription()
Returns:
true if this is a regular data description entry (not a condition or nemae clause)

isArray

public boolean isArray()
in COBOL arrays are either occurring items (normal arrays) or optional items (they occur no time or once).

Returns:
true if this item is an array

isVariableSizeArray

public boolean isVariableSizeArray()
Returns:
true if this is a variable size array

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2015 LegSem. All Rights Reserved.