SandMark version 2.1


sandmark.statistics
Class HalsteadMeasures

java.lang.Object
  |
  +--sandmark.statistics.HalsteadMeasures

public class HalsteadMeasures
extends java.lang.Object


Constructor Summary
HalsteadMeasures()
           
 
Method Summary
 java.util.Vector evalMeasures(java.util.Iterator itr)
          Evaluates the Halstead measures n1,n2,N1 and N2
 int getMeasure(java.lang.String measure)
          Returns the value corresponding to the given measure
 java.lang.String getOperand(EDU.purdue.cs.bloat.editor.Instruction instruct)
          Returns the operand of the given 'operand instruction' if present returns 'none' if not an operand instruction
 java.lang.String getOperatorType(EDU.purdue.cs.bloat.editor.Instruction instruct)
          Gets the operator type of the given instruction returns 'none' if not an operator instruction
 boolean isAdd(EDU.purdue.cs.bloat.editor.Instruction instruct)
          Returns true if instruction is an add instruction
 boolean isDiv(EDU.purdue.cs.bloat.editor.Instruction instruct)
          Returns true if instruction is a div instruction
 boolean isMul(EDU.purdue.cs.bloat.editor.Instruction instruct)
          Returns true if instruction is a mul instruction
 boolean isNew(EDU.purdue.cs.bloat.editor.Instruction instruct)
          Returns true if instruction is a new instruction
 boolean isPutfield(EDU.purdue.cs.bloat.editor.Instruction instruct)
          Returns true if instruction is a putfield instruction
 boolean isPutstatic(EDU.purdue.cs.bloat.editor.Instruction instruct)
          Returns true if instruction is a putstatic instruction
 boolean isRem(EDU.purdue.cs.bloat.editor.Instruction instruct)
          Returns true if instruction is a rem instruction
 boolean isSub(EDU.purdue.cs.bloat.editor.Instruction instruct)
          Returns true if instruction is a sub instruction
 void setMeasure(java.lang.String measure, int value)
          Sets measure with the corresponding value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HalsteadMeasures

public HalsteadMeasures()
Method Detail

getMeasure

public int getMeasure(java.lang.String measure)
Returns the value corresponding to the given measure

Parameters:
measure - the symbolic name of the measure whose value is needed
Returns:
the value corresponding to that measure

setMeasure

public void setMeasure(java.lang.String measure,
                       int value)
Sets measure with the corresponding value

Parameters:
measure - the symbolic name of the measure
value - the value to be set

evalMeasures

public java.util.Vector evalMeasures(java.util.Iterator itr)
Evaluates the Halstead measures n1,n2,N1 and N2

Returns:
resultVector result vector containing the Halstead measures in the order N1, N2, n1, n2

getOperatorType

public java.lang.String getOperatorType(EDU.purdue.cs.bloat.editor.Instruction instruct)
Gets the operator type of the given instruction returns 'none' if not an operator instruction

Parameters:
instruct - the instruction to be analyzed
Returns:
operType the operator type of the instruction

getOperand

public java.lang.String getOperand(EDU.purdue.cs.bloat.editor.Instruction instruct)
Returns the operand of the given 'operand instruction' if present returns 'none' if not an operand instruction

Parameters:
instruct - the instruction to be analyzed

isAdd

public boolean isAdd(EDU.purdue.cs.bloat.editor.Instruction instruct)
Returns true if instruction is an add instruction

Parameters:
instruct - the instruction to be analyzed

isSub

public boolean isSub(EDU.purdue.cs.bloat.editor.Instruction instruct)
Returns true if instruction is a sub instruction

Parameters:
instruct - the instruction to be analyzed

isMul

public boolean isMul(EDU.purdue.cs.bloat.editor.Instruction instruct)
Returns true if instruction is a mul instruction

Parameters:
instruct - the instruction to be analyzed

isDiv

public boolean isDiv(EDU.purdue.cs.bloat.editor.Instruction instruct)
Returns true if instruction is a div instruction

Parameters:
instruct - the instruction to be analyzed

isRem

public boolean isRem(EDU.purdue.cs.bloat.editor.Instruction instruct)
Returns true if instruction is a rem instruction

Parameters:
instruct - the instruction to be analyzed

isPutstatic

public boolean isPutstatic(EDU.purdue.cs.bloat.editor.Instruction instruct)
Returns true if instruction is a putstatic instruction

Parameters:
instruct - the instruction to be analyzed

isPutfield

public boolean isPutfield(EDU.purdue.cs.bloat.editor.Instruction instruct)
Returns true if instruction is a putfield instruction

Parameters:
instruct - the instruction to be analyzed

isNew

public boolean isNew(EDU.purdue.cs.bloat.editor.Instruction instruct)
Returns true if instruction is a new instruction

Parameters:
instruct - the instruction to be analyzed

SandMark version 2.1

Wed Jul 3 17:27:43 MST 2002