Style Intelligence v12.0

inetsoft.uql
Class ColumnSelection

java.lang.Object
  extended by inetsoft.uql.ColumnSelection
All Implemented Interfaces:
inetsoft.util.XMLSerializable, Serializable, Cloneable

public class ColumnSelection
extends Object
implements inetsoft.util.XMLSerializable, Cloneable, Serializable

A Column represents a selection of query column, data model attributes or formula expressions. To use Columnelection with query columns or formula expressions, use DataRef objects where the attribute property is the column name and the entity property is null.

See Also:
DataRef, Serialized Form

Constructor Summary
ColumnSelection()
          Construct a new instance of ColumnSelection.
 
Method Summary
 void addAttribute(DataRef attribute)
          Add a data model attribute or expression to the selection.
 void addAttribute(DataRef attribute, boolean exclusive)
          Add a data model attribute or expression to the selection.
 void addAttribute(int index, DataRef attribute)
          Add an attribute or expression to the selection at specified index.
 void clear()
          Clear all attributes from this selection.
 Object clone()
          Make a deep copy of this column selection.
 Object clone(boolean shallow)
          Clone the column selection.
 boolean containsAttribute(DataRef attribute)
          Check if an attribute or expression is already defined in the selection.
 void copyPropertiesTo(ColumnSelection columns)
          Copy properties to target columns.
 boolean equals(Object obj)
          Compare two column selection list.
 boolean equals(Object obj, boolean strict)
          Compare two column selection list.
 DataRef findAttribute(DataRef attribute)
          Find the contained attribute equals to an attribute.
 DataRef getAttribute(int idx)
          Get an attribute or an expression.
 DataRef getAttribute(String name)
          Get an attribute or an expression.
 DataRef getAttribute(String name, boolean fuzz)
          Get an attribute or an expression.
 int getAttributeCount()
          Get the number of attributes anr expressions in this selection.
 Enumeration getAttributes()
          Get a list of all attributes and expressions in this selection.
 Enumeration getProperties()
          Get all the property keys.
 Object getProperty(String key)
          Get the value of a property.
 int hashCode()
          Get the hashcode.
 int indexOfAttribute(DataRef attribute)
          Get index of an attribute.
 boolean isEmpty()
          Check if the column selection is empty.
 void parseXML(Element tag)
          Read in the XML representation of this object.
 void removeAllAttributes()
          Remove all attributes and expressions from the selection.
 void removeAttribute(DataRef attribute)
          Remove the specified attribute or expression from the selection.
 void removeAttribute(int idx)
          Remove the specified attribute or expression from the selection.
 void removeAttributes(ColumnSelection columns)
          Remove all the attributes come from another column selection.
 void setAttribute(int idx, DataRef attribute)
          Set the data ref at the specified index.
 void setProperty(String key, Object value)
          Set the value a property.
 void sortByName()
          Sort a list of all attributes and expressions in this selection.
 String toString()
           
 void writeXML(PrintWriter writer)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColumnSelection

public ColumnSelection()
Construct a new instance of ColumnSelection.

Method Detail

removeAttributes

public void removeAttributes(ColumnSelection columns)
Remove all the attributes come from another column selection.

Parameters:
columns - the specified column selection.

clear

public void clear()
Clear all attributes from this selection.


addAttribute

public void addAttribute(DataRef attribute)
Add a data model attribute or expression to the selection.

Parameters:
attribute - an DataRef object describing a data model attribute or expression.

addAttribute

public void addAttribute(DataRef attribute,
                         boolean exclusive)
Add a data model attribute or expression to the selection.

Parameters:
attribute - an DataRef object describing a data model attribute or expression.
exclusive - true if exclusive.

addAttribute

public void addAttribute(int index,
                         DataRef attribute)
Add an attribute or expression to the selection at specified index.

Parameters:
index - the specified index.
attribute - the DataRef object to be added.

containsAttribute

public boolean containsAttribute(DataRef attribute)
Check if an attribute or expression is already defined in the selection.


findAttribute

public DataRef findAttribute(DataRef attribute)
Find the contained attribute equals to an attribute.

Parameters:
attribute - the specified attribute.
Returns:
the contained attribute equals to the attribute, null not found.

indexOfAttribute

public int indexOfAttribute(DataRef attribute)
Get index of an attribute.

Parameters:
attribute - the specified attribute
Returns:
index of the attribute

removeAttribute

public void removeAttribute(DataRef attribute)
Remove the specified attribute or expression from the selection.

Parameters:
attribute - an DataRef object describing a data model attribute or expression.

removeAttribute

public void removeAttribute(int idx)
Remove the specified attribute or expression from the selection.

Parameters:
idx - the index of the attribute to remove.

getAttributes

public final Enumeration getAttributes()
Get a list of all attributes and expressions in this selection.

Returns:
a collection of DataRef objects

setAttribute

public final void setAttribute(int idx,
                               DataRef attribute)
Set the data ref at the specified index.

Parameters:
idx - the attribute index.
attribute - an DataRef object will be set to the index.

getAttribute

public final DataRef getAttribute(int idx)
Get an attribute or an expression.

Parameters:
idx - attribute index.

sortByName

public void sortByName()
Sort a list of all attributes and expressions in this selection.


getAttribute

public DataRef getAttribute(String name)
Get an attribute or an expression.

Parameters:
name - the name of the attribute whose DataRef object is desired.
Returns:
either DataRef object for a given attribute or null.

getAttribute

public DataRef getAttribute(String name,
                            boolean fuzz)
Get an attribute or an expression.

Parameters:
name - the name of the attribute whose DataRef object is desired.
Returns:
either DataRef object for a given attribute or null.

getAttributeCount

public int getAttributeCount()
Get the number of attributes anr expressions in this selection.

Returns:
the number of attributes and expressions in this selection.

removeAllAttributes

public void removeAllAttributes()
Remove all attributes and expressions from the selection.


isEmpty

public boolean isEmpty()
Check if the column selection is empty.

Returns:
true if empty, false otherwise.

writeXML

public void writeXML(PrintWriter writer)
Specified by:
writeXML in interface inetsoft.util.XMLSerializable

parseXML

public void parseXML(Element tag)
              throws Exception,
                     DOMException
Read in the XML representation of this object.

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

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
Make a deep copy of this column selection.

Overrides:
clone in class Object

clone

public Object clone(boolean shallow)
Clone the column selection.

Parameters:
shallow - true if the attributes should not be cloned, false otherwise.
Returns:
the cloned column selection.

equals

public boolean equals(Object obj)
Compare two column selection list.

Overrides:
equals in class Object

equals

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

Parameters:
strict - false to check only the entity/attribute of attributes. Otherwise other properties are compared, such as alias, width.

getProperty

public Object getProperty(String key)
Get the value of a property.

Parameters:
key - the specified property name.
Returns:
the value of the property.

setProperty

public void setProperty(String key,
                        Object value)
Set the value a property.

Parameters:
key - the property name.
value - the property value, null to remove the property.

getProperties

public Enumeration getProperties()
Get all the property keys.

Returns:
all the property keys.

copyPropertiesTo

public void copyPropertiesTo(ColumnSelection columns)
Copy properties to target columns.


hashCode

public int hashCode()
Get the hashcode.

Overrides:
hashCode in class Object

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