Style Intelligence v12.0

inetsoft.uql.asset
Class AggregateRef

java.lang.Object
  extended by inetsoft.uql.erm.AbstractDataRef
      extended by inetsoft.uql.asset.AggregateRef
All Implemented Interfaces:
AssetObject, IAggregateRef, CalcAggregate, DataRef, DataRefWrapper, inetsoft.util.ContentObject, inetsoft.util.DataSerializable, inetsoft.util.XMLSerializable, Serializable, Cloneable, Comparable

public class AggregateRef
extends AbstractDataRef
implements AssetObject, DataRefWrapper, inetsoft.util.ContentObject, IAggregateRef, CalcAggregate

AggregateRef represents a data ref has aggregate.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class inetsoft.uql.erm.AbstractDataRef
chash, cname
 
Fields inherited from interface inetsoft.uql.erm.DataRef
AGG_CALC, CUBE, CUBE_DIMENSION, CUBE_MEASURE, CUBE_MODEL_DIMENSION, CUBE_MODEL_TIME_DIMENSION, CUBE_TIME_DIMENSION, DIMENSION, MEASURE, MODEL, NONE, TIME
 
Constructor Summary
AggregateRef()
          Constructor.
AggregateRef(DataRef ref, AggregateFormula formula)
          Constructor for an aggregate that calculates results from one column.
AggregateRef(DataRef ref, DataRef ref2, AggregateFormula formula)
          Constructor for an aggregate that calculates results from two columns.
 
Method Summary
 Object clone()
          Clone the object.
 boolean equalsAggregate(Object obj)
          Check if equals another object.
 boolean equalsContent(Object obj)
          Check if equals another object in content.
 String getAttribute()
          Get the referenced attribute.
 Enumeration getAttributes()
          Get a list of all attributes that are referenced by this object.
 DataRef getDataRef()
          Get the contained data ref.
 String getDataType()
          Get the data type.
 Enumeration getEntities()
          Get the attribute's parent entity.
 String getEntity()
          Get the attribute's parent entity.
 String getExpression(AggregateHelper helper)
          Get the SQL expression for this aggregate.
 AggregateFormula getFormula()
          Get the formula.
 String getFormulaName()
          Get the formula.
 String getName()
          Get the name of the field.
 int getPercentageOption()
          Get the percentage option of the aggregate ref.
 int getPercentageType()
          Get the percentage type.
 int getRefType()
          Get the type of the field.
 DataRef getSecondaryColumn()
          Get the formula secondary column.
 Collection getSubAggregates()
          Get the aggregate columns that could be used to calculate this formula.
 String getUID()
          Get an unique id for the formula that can be used to identify an aggregate column.
 boolean isAggregated()
          Test if the aggregate info is aggregated.
 boolean isComposite()
          Check if is one sub aggregate for composite.
 boolean isEntityBlank()
          Determine if the entity is blank.
 boolean isExpression()
          Check if the attribute is an expression.
 boolean isPercentage()
          Check if shown as a percentage.
 boolean isUserCreate()
          Check if user created aggregate ref.
protected  void parseAttributes(Element tag)
          Read in the attribute of this object from an XML tag.
protected  void parseContents(Element tag)
          Read in the contents of this object from an xml tag.
 boolean printKey(PrintWriter writer)
          Print the key to identify this content object.
 void refreshDataRef(ColumnSelection cols)
          Refresh the contained data ref.
 void setComposite(boolean composite)
          Set whether is one sub aggregate for composite.
 void setDataRef(DataRef ref)
          Set the contained data ref.
 void setFormula(AggregateFormula formula)
          Set the formula to the aggregate ref.
 void setFormulaName(String name)
          Set the formula name to the aggregate ref.
 void setPercentage(boolean percentage)
          Set the percentage option.
 void setPercentageOption(int percentageOption)
          Set the percentage option of the aggregate ref.
 void setPercentageType(int type)
          Set the percentage type.
 void setSecondaryColumn(DataRef ref)
          Set the secondary column to be used in the formula.
 void setUserCreate(boolean userCreate)
          Set whether is user created aggregate ref.
 String toString()
          Get the string representation.
 String toView()
          Get the view representation of this field.
protected  void writeAttributes(PrintWriter writer)
          Write the attributes of this object.
protected  void writeAttributes2(DataOutputStream dos)
          Write the attributes of this object.
protected  void writeContents(PrintWriter writer)
          Write the contents of this object.
protected  void writeContents2(DataOutputStream dos)
          Write the contents of this object.
 
Methods inherited from class inetsoft.uql.erm.AbstractDataRef
addr, compareTo, createDataRef, equals, equals, getClass, getDefaultFormula, getTypeNode, hashCode, isEmpty, parseCDATA, parseData, parseXML, writeCDATA, writeCDATA2, writeData, writeXML
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface inetsoft.uql.erm.DataRef
addr, equals, getDefaultFormula, getTypeNode, isEmpty, parseData, writeData
 
Methods inherited from interface inetsoft.util.XMLSerializable
parseXML, writeXML
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

AggregateRef

public AggregateRef()
Constructor.


AggregateRef

public AggregateRef(DataRef ref,
                    AggregateFormula formula)
Constructor for an aggregate that calculates results from one column.


AggregateRef

public AggregateRef(DataRef ref,
                    DataRef ref2,
                    AggregateFormula formula)
Constructor for an aggregate that calculates results from two columns.

Method Detail

getRefType

public int getRefType()
Get the type of the field.

Specified by:
getRefType in interface DataRef
Returns:
the type of the field.

isExpression

public boolean isExpression()
Check if the attribute is an expression.

Specified by:
isExpression in interface DataRef
Returns:
true if is an expression, false otherwise.

getEntity

public String getEntity()
Get the attribute's parent entity.

Specified by:
getEntity in interface DataRef
Returns:
the name of the entity.

getEntities

public Enumeration getEntities()
Get the attribute's parent entity.

Specified by:
getEntities in interface DataRef
Overrides:
getEntities in class AbstractDataRef
Returns:
an Enumeration with the name of the entity.

getAttribute

public String getAttribute()
Get the referenced attribute.

Specified by:
getAttribute in interface DataRef
Returns:
the name of the attribute.

getAttributes

public Enumeration getAttributes()
Get a list of all attributes that are referenced by this object.

Specified by:
getAttributes in interface DataRef
Overrides:
getAttributes in class AbstractDataRef
Returns:
an Enumeration containing AttributeRef objects.

isEntityBlank

public boolean isEntityBlank()
Determine if the entity is blank.

Specified by:
isEntityBlank in interface DataRef
Overrides:
isEntityBlank in class AbstractDataRef
Returns:
true if entity is null or blank.

getName

public String getName()
Get the name of the field.

Specified by:
getName in interface DataRef
Overrides:
getName in class AbstractDataRef
Returns:
the name of the field.

getExpression

public String getExpression(AggregateHelper helper)
Get the SQL expression for this aggregate.


getUID

public String getUID()
Get an unique id for the formula that can be used to identify an aggregate column.


getDataRef

public DataRef getDataRef()
Get the contained data ref.

Specified by:
getDataRef in interface DataRefWrapper
Returns:
the contained data ref.

setDataRef

public void setDataRef(DataRef ref)
Set the contained data ref.

Specified by:
setDataRef in interface DataRefWrapper
Parameters:
ref - the specified data ref.

refreshDataRef

public void refreshDataRef(ColumnSelection cols)
Refresh the contained data ref.

Parameters:
cols - the specified column selection.

getDataType

public String getDataType()
Get the data type.

Specified by:
getDataType in interface DataRef
Overrides:
getDataType in class AbstractDataRef
Returns:
the data type defined in XSchema.

writeAttributes

protected void writeAttributes(PrintWriter writer)
Write the attributes of this object.

Specified by:
writeAttributes in class AbstractDataRef
Parameters:
writer - the output stream to which to write the XML data.

writeAttributes2

protected void writeAttributes2(DataOutputStream dos)
Write the attributes of this object.

Overrides:
writeAttributes2 in class AbstractDataRef
Parameters:
dos - the output stream to which to write the OutputStream data.

parseAttributes

protected void parseAttributes(Element tag)
                        throws Exception
Read in the attribute of this object from an XML tag.

Specified by:
parseAttributes in class AbstractDataRef
Parameters:
tag - the XML element representing this object.
Throws:
Exception

writeContents

protected void writeContents(PrintWriter writer)
Write the contents of this object.

Overrides:
writeContents in class AbstractDataRef
Parameters:
writer - the output stream to which to write the XML data.

writeContents2

protected void writeContents2(DataOutputStream dos)
Write the contents of this object.

Overrides:
writeContents2 in class AbstractDataRef
Parameters:
dos - the output stream to which to write the stream data.

parseContents

protected void parseContents(Element tag)
                      throws Exception
Read in the contents of this object from an xml tag.

Overrides:
parseContents in class AbstractDataRef
Parameters:
tag - the specified xml element.
Throws:
Exception

isPercentage

public boolean isPercentage()
Check if shown as a percentage.

Returns:
true if yes, false otherwise.

setPercentage

public void setPercentage(boolean percentage)
Set the percentage option.

Parameters:
percent - true if shown as a percentage, false otherwise.

getPercentageOption

public int getPercentageOption()
Get the percentage option of the aggregate ref.

Specified by:
getPercentageOption in interface IAggregateRef
Returns:
the percentage option of this reference.

setPercentageOption

public void setPercentageOption(int percentageOption)
Set the percentage option of the aggregate ref.

Specified by:
setPercentageOption in interface IAggregateRef
Parameters:
percentage - the percentage option of this reference.

getFormula

public AggregateFormula getFormula()
Get the formula.

Specified by:
getFormula in interface IAggregateRef
Returns:
the formula of the aggregate ref.

getFormulaName

public String getFormulaName()
Get the formula.

Specified by:
getFormulaName in interface CalcAggregate
Returns:
the formula name.

setFormulaName

public void setFormulaName(String name)
Set the formula name to the aggregate ref.

Specified by:
setFormulaName in interface CalcAggregate
Parameters:
formula - name the specified formula.

getPercentageType

public int getPercentageType()
Get the percentage type.

Specified by:
getPercentageType in interface CalcAggregate
Returns:
the percentage type

setPercentageType

public void setPercentageType(int type)
Set the percentage type.

Specified by:
setPercentageType in interface CalcAggregate
Parameters:
type - the specified percentage type

setFormula

public void setFormula(AggregateFormula formula)
Set the formula to the aggregate ref.

Specified by:
setFormula in interface IAggregateRef
Parameters:
formula - the specified formula.

isAggregated

public boolean isAggregated()
Test if the aggregate info is aggregated.

Returns:
true if the aggregate info is aggregated, false otherwise.

getSecondaryColumn

public DataRef getSecondaryColumn()
Get the formula secondary column.

Specified by:
getSecondaryColumn in interface IAggregateRef
Returns:
secondary column.

setSecondaryColumn

public void setSecondaryColumn(DataRef ref)
Set the secondary column to be used in the formula.

Specified by:
setSecondaryColumn in interface IAggregateRef
Parameters:
ref - formula secondary column.

getSubAggregates

public Collection getSubAggregates()
Get the aggregate columns that could be used to calculate this formula.

Returns:
an empty collection if this formula can not be composed from other formulas. Otherwise returns a collection of the aggregate columns that can be used to calculate this function.

equalsAggregate

public boolean equalsAggregate(Object obj)
Check if equals another object.

Parameters:
obj - the specified object.
Returns:
true if yes, false otherwise.

printKey

public boolean printKey(PrintWriter writer)
                 throws Exception
Print the key to identify this content object. If the keys of two content objects are equal, the content objects are equal too.

Specified by:
printKey in interface inetsoft.util.ContentObject
Throws:
Exception

equalsContent

public boolean equalsContent(Object obj)
Check if equals another object in content.

Specified by:
equalsContent in interface inetsoft.util.ContentObject
Parameters:
obj - the specified object.
Returns:
true if equals the object in content, false otherwise.

toString

public String toString()
Get the string representation.

Overrides:
toString in class AbstractDataRef
Returns:
the string representation.

toView

public String toView()
Get the view representation of this field.

Specified by:
toView in interface DataRef
Returns:
the view representation of this field.

isComposite

public boolean isComposite()
Check if is one sub aggregate for composite.


setComposite

public void setComposite(boolean composite)
Set whether is one sub aggregate for composite.


isUserCreate

public boolean isUserCreate()
Check if user created aggregate ref.


setUserCreate

public void setUserCreate(boolean userCreate)
Set whether is user created aggregate ref.


clone

public Object clone()
Clone the object.

Specified by:
clone in interface AssetObject
Specified by:
clone in interface DataRef
Overrides:
clone in class AbstractDataRef
Returns:
the cloned object.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.