canguru.descriptor
Class Filtered

java.lang.Object
  |
  +--canguru.descriptor.Filtered

public class Filtered
extends java.lang.Object


Field Summary
private  Descriptor descriptor
           
private  java.util.Map elements
           
private  java.util.Set filter
           
 
Constructor Summary
(package private) Filtered(Descriptor descriptor)
           
 
Method Summary
 void addElement(java.lang.Long id)
          Adiciona um elemento
 void addFilter(java.lang.String attributeName, java.lang.Object attributeValue)
          Insere filtro por atributo
 AttributeType getAttributeType(java.lang.String attributeName)
          Retorna o tipo de um atributo
 Element getElement(java.lang.Long id)
          Retorna o elemento com o id informado
 java.util.Map getElements()
          Retorna o Map com os elementos filtrados no formato (idElemento, elemento)
 java.util.Map getEntityDefinition()
          Retorna o Map com a definição dos atributos filtrados no formato (nomeAtributo, tipoAtributo)
 java.lang.String getEntityName()
          Retorna o nome da entidade a ser tratada
 java.util.Set getFilter()
          Retorna o Set com os atributos a serem usados para filtro
 void load()
          Carrega todos os elementos no banco de dados no Map de elementos
 void removeAllElements()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filter

private java.util.Set filter

descriptor

private Descriptor descriptor

elements

private java.util.Map elements
Constructor Detail

Filtered

Filtered(Descriptor descriptor)
Parameters:
descriptor -
Method Detail

addElement

public void addElement(java.lang.Long id)
                throws ElementNotFoundException
Adiciona um elemento

ElementNotFoundException

addFilter

public void addFilter(java.lang.String attributeName,
                      java.lang.Object attributeValue)
               throws AttributeDefinitionNotFoundException,
                      InvalidNameException,
                      InvalidAttributeException
Insere filtro por atributo

Parameters:
attributeName - nome do atributo
attributeValue - valor que o atributo deve ter
AttributeDefinitionNotFoundException
InvalidNameException
InvalidAttributeException

getAttributeType

public AttributeType getAttributeType(java.lang.String attributeName)
                               throws AttributeNotFoundException
Retorna o tipo de um atributo

Parameters:
attributeName - Nome do atributo
Returns:
tipo do atributo
AttributeNotFoundException

getElement

public Element getElement(java.lang.Long id)
                   throws ElementNotFoundException
Retorna o elemento com o id informado

Returns:
elemento
Throws:
ElementNotFoundException

getElements

public java.util.Map getElements()
Retorna o Map com os elementos filtrados no formato (idElemento, elemento)

Returns:
elements mapa com os elementos

getEntityDefinition

public java.util.Map getEntityDefinition()
Retorna o Map com a definição dos atributos filtrados no formato (nomeAtributo, tipoAtributo)

Returns:
entityDefinition mapa com definições

getEntityName

public java.lang.String getEntityName()
Retorna o nome da entidade a ser tratada

Returns:
entityName nome da entidade

getFilter

public java.util.Set getFilter()
Retorna o Set com os atributos a serem usados para filtro

Returns:
set com os atributos

load

public void load()
          throws java.lang.ClassNotFoundException,
                 java.io.IOException,
                 java.sql.SQLException,
                 ElementNotFoundException
Carrega todos os elementos no banco de dados no Map de elementos

java.lang.ClassNotFoundException
java.io.IOException
java.sql.SQLException
ElementNotFoundException

removeAllElements

public void removeAllElements()