de.enough.polish.dataeditor
Class CountTerm

java.lang.Object
  extended by de.enough.polish.dataeditor.CountTerm

public class CountTerm
extends Object

Represents a simple term for calculating the number of entries of a specific data entry.

Copyright Enough Software 2004 - 2011

 history
        19-Oct-2004 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
static int OPERATION_ADD
           
static int OPERATION_DEVIDE
           
static int OPERATION_MULTIPLY
           
static int OPERATION_SUBTRACT
           
 
Constructor Summary
CountTerm(int operation, DataEntry[] operants)
          Creates a new term.
 
Method Summary
 int calculateCount()
           
static CountTerm createTerm(String term, DataManager manager)
           
 int getColumns()
           
 DataEntry[] getOperants()
           
 int getRows()
           
 String toCodeString()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPERATION_ADD

public static final int OPERATION_ADD
See Also:
Constant Field Values

OPERATION_SUBTRACT

public static final int OPERATION_SUBTRACT
See Also:
Constant Field Values

OPERATION_MULTIPLY

public static final int OPERATION_MULTIPLY
See Also:
Constant Field Values

OPERATION_DEVIDE

public static final int OPERATION_DEVIDE
See Also:
Constant Field Values
Constructor Detail

CountTerm

public CountTerm(int operation,
                 DataEntry[] operants)
Creates a new term.

Parameters:
operation - the operation, either OPERATION_ADD, OPERATION_SUBTRACT, OPERATION_MULTIPLY or OPERATION_DEVIDE
operants - the entries which are used in this calculation
Method Detail

calculateCount

public int calculateCount()

toString

public String toString()
Overrides:
toString in class Object

toCodeString

public String toCodeString()
Returns:
the string representation

createTerm

public static CountTerm createTerm(String term,
                                   DataManager manager)
Parameters:
term - the term string
manager - the data manager
Returns:
the term object

getOperants

public DataEntry[] getOperants()
Returns:
the data

getColumns

public int getColumns()
Returns:
the number of columns for this term

getRows

public int getRows()
Returns:
the number of rows for this term