Style Intelligence v12.0

inetsoft.uql.erm
Class AbstractDataRef

java.lang.Object
  extended by inetsoft.uql.erm.AbstractDataRef
All Implemented Interfaces:
DataRef, inetsoft.util.DataSerializable, inetsoft.util.XMLSerializable, Serializable, Cloneable, Comparable
Direct Known Subclasses:
AggregateRef, AttributeRef, ColumnRef, ExpressionRef, GroupRef, SortRef

public abstract class AbstractDataRef
extends Object
implements DataRef

Abstract class holding a reference to a SQL expression or an attribute.

See Also:
Serialized Form

Field Summary
protected  int chash
           
protected  String 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
AbstractDataRef()
           
 
Method Summary
 int addr()
          Get the original hash code.
 Object clone()
          Create a copy of this object.
 int compareTo(Object obj)
          Compare to another object.
static DataRef createDataRef(Element elem)
          Create a DataRef from an xml element.
 boolean equals(Object obj)
          Check if equals another object.
 boolean equals(Object obj, boolean strict)
          Compare two column refs.
 Enumeration getAttributes()
          Get a list of all attributes that are referenced by this object.
static String getClass(Class cobj, boolean compact)
          Get the class name.
 String getDataType()
          Get the data type.
 String getDefaultFormula()
          Get the default formula.
 Enumeration getEntities()
          Get the attribute's parent entity.
 String getName()
          Get the name of the field.
 XTypeNode getTypeNode()
          Get the type node.
 int hashCode()
          Get the hash code value for the object.
 boolean isEmpty()
          Check if the data ref is empty.
 boolean isEntityBlank()
          Determine if the entity is blank.
protected abstract  void parseAttributes(Element tag)
          Read in the attribute of this object from an XML tag.
protected  void parseCDATA(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 parseData(DataInputStream input)
          Parse data from an InputStream.
 void parseXML(Element tag)
          Read in the definition of this object from an XML tag.
 String toString()
          Get the string presentation of a data ref.
protected abstract  void writeAttributes(PrintWriter writer)
          Write the attributes of this object.
protected  void writeAttributes2(DataOutputStream dos)
          Write the attributes of this object.
protected  void writeCDATA(PrintWriter writer)
          Write the CDATA of this object.
protected  void writeCDATA2(DataOutputStream dos)
          Write the CDATA 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.
 void writeData(DataOutputStream dos)
          Write data to a DataOutputStream.
 void writeXML(PrintWriter writer)
          Write an xml element representation of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface inetsoft.uql.erm.DataRef
getAttribute, getEntity, getRefType, isExpression, toView
 

Field Detail

cname

protected String cname

chash

protected int chash
Constructor Detail

AbstractDataRef

public AbstractDataRef()
Method Detail

getClass

public static String getClass(Class cobj,
                              boolean compact)
Get the class name.


createDataRef

public static DataRef createDataRef(Element elem)
                             throws Exception
Create a DataRef from an xml element.

Parameters:
elem - the specified xml element.
Returns:
the created DataRef.
Throws:
Exception

getEntities

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

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

getAttributes

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

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

isEntityBlank

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

Specified by:
isEntityBlank in interface DataRef
Returns:
true if entity is null or entity is equal to empty string ("").

isEmpty

public boolean isEmpty()
Check if the data ref is empty.

Specified by:
isEmpty in interface DataRef
Returns:
true if empty, false otherwise.

getName

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

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

writeXML

public void writeXML(PrintWriter writer)
Write an xml element representation of this object.

Specified by:
writeXML in interface inetsoft.util.XMLSerializable
Parameters:
writer - the output stream to which to write the XML data.

writeAttributes

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

Parameters:
writer - the output stream to which to write the XML data.

writeAttributes2

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

Parameters:
dos - the output stream to which to write the XML data.

writeCDATA

protected void writeCDATA(PrintWriter writer)
Write the CDATA of this object.

Parameters:
writer - the output stream to which to write the XML data.

writeCDATA2

protected void writeCDATA2(DataOutputStream dos)
Write the CDATA of this object.

Parameters:
dos - the output stream to which to write the OutputStream data.

writeContents

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

Parameters:
writer - the output stream to which to write the XML data.

writeContents2

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

Parameters:
dos - the output stream to which to write the OutputStream data.

parseXML

public void parseXML(Element tag)
              throws Exception
Read in the definition of this object from an XML tag.

Specified by:
parseXML in interface inetsoft.util.XMLSerializable
Parameters:
tag - the xml element representing this object.
Throws:
Exception

writeData

public void writeData(DataOutputStream dos)
Write data to a DataOutputStream.

Specified by:
writeData in interface DataRef
Specified by:
writeData in interface inetsoft.util.DataSerializable
Parameters:
dos - the destination DataOutputStream.

parseData

public boolean parseData(DataInputStream input)
Parse data from an InputStream.

Specified by:
parseData in interface DataRef
Specified by:
parseData in interface inetsoft.util.DataSerializable
Parameters:
input - the source DataInputStream.
Returns:
true if successfully parsed, false otherwise.

parseAttributes

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

Parameters:
tag - the xml element representing this object.
Throws:
Exception

parseCDATA

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

Parameters:
tag - the xml element representing this object.
Throws:
Exception

parseContents

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

Parameters:
tag - the specified xml element.
Throws:
Exception

getDataType

public String getDataType()
Get the data type.

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

getTypeNode

public XTypeNode getTypeNode()
Get the type node.

Specified by:
getTypeNode in interface DataRef
Returns:
the type node of the column ref.

equals

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

Overrides:
equals in class Object
Parameters:
obj - the specified object.
Returns:
true if equals, false otherwise.

equals

public boolean equals(Object obj,
                      boolean strict)
Compare two column refs.

Specified by:
equals in interface DataRef
Parameters:
strict - true to compare all properties of ColumnRef. Otherwise only entity and attribute are compared.

hashCode

public int hashCode()
Get the hash code value for the object.

Overrides:
hashCode in class Object
Returns:
the hash code value for this object.

addr

public int addr()
Get the original hash code.

Specified by:
addr in interface DataRef
Returns:
the original hash code.

toString

public String toString()
Get the string presentation of a data ref.

Overrides:
toString in class Object

clone

public Object clone()
Create a copy of this object.

Specified by:
clone in interface DataRef
Overrides:
clone in class Object
Returns:
a copy of this object.

compareTo

public int compareTo(Object obj)
Compare to another object.

Specified by:
compareTo in interface Comparable
Parameters:
obj - the specified object to compare.
Returns:
the comparison result.

getDefaultFormula

public String getDefaultFormula()
Get the default formula.

Specified by:
getDefaultFormula in interface DataRef

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