Example usage for org.apache.commons.collections.list LazyList decorate

List of usage examples for org.apache.commons.collections.list LazyList decorate

Introduction

In this page you can find the example usage for org.apache.commons.collections.list LazyList decorate.

Prototype

public static List decorate(List list, Factory factory) 

Source Link

Document

Factory method to create a lazily instantiating list.

Usage

From source file:de.fhg.fokus.hss.form.GussForm.java

public void reset(ActionMapping arg0, HttpServletRequest arg1) {
    LOGGER.debug("entering");
    super.reset(arg0, arg1);
    uiccType = GussBO.GUS;//from   w w w . j a v a  2 s . c  om
    keyLifeTime = GussBO.LIFE_TIME_DEFAULT;
    Factory factory = new Factory() {
        public Object create() {
            return new UssForm();
        }
    };

    ussList = LazyList.decorate(new ArrayList(), factory);
    LOGGER.debug("exiting");
}

From source file:de.fhg.fokus.hss.web.form.GBA_USS_Form.java

public void reset(ActionMapping actionMapping, HttpServletRequest request) {
    this.id_impi = 0;
    this.identity = null;
    this.uicc_type = ZhConstants.UICC_Type_Basic_GBA;
    this.key_life_time = ZhConstants.Default_Key_Life_Time;
    this.default_auth_scheme = CxConstants.Auth_Scheme_AKAv1;

    Factory factory = new Factory() {
        public Object create() {
            return new USS_Form();
        }/*from   ww  w.j a  v  a  2s. com*/
    };

    this.ussList = LazyList.decorate(new ArrayList(), factory);
}

From source file:de.fhg.fokus.hss.form.TriggerPointForm.java

public void reset(ActionMapping arg0, HttpServletRequest arg1) {
    LOGGER.debug("entering");
    trigPtId = null;/*from  w w w  .jav a2  s  . c o  m*/
    trigPtName = null;
    cnf = 0;
    type = -1;
    group = -1;

    Factory factory = new Factory() {
        public Object create() {
            return new SptForm();
        }
    };

    spts = LazyList.decorate(new ArrayList(), factory);
    LOGGER.debug("exiting");
}

From source file:de.fhg.fokus.hss.web.form.TP_Form.java

public void reset(ActionMapping actionMapping, HttpServletRequest request) {
    this.id = -1;
    this.name = null;
    this.condition_type_cnf = CxConstants.ConditionType_CNF;

    Factory factory = new Factory() {
        public Object create() {
            return new SPT_Form();
        }//from  w w w .  j a  v a2 s . c  o m
    };

    this.spts = LazyList.decorate(new ArrayList(), factory);
    this.type = 0;
    this.group = 1;
    this.nextAction = null;
    this.ifc_id = -1;
    this.associated_ID = -1;
    this.select_ifc = null;
}

From source file:gov.nih.nci.cabig.caaers.domain.TreatmentInformation.java

/**
 * Creates the lazy course agents./*from   w  ww . ja  v  a  2s . com*/
 */
@SuppressWarnings("unchecked")
private void createLazyCourseAgents() {
    this.courseAgents = LazyList.decorate(getCourseAgentsInternal(), new InstantiateFactory(CourseAgent.class));
}

From source file:it.cilea.osd.jdyna.util.AnagraficaUtils.java

/**
 * Fill DTO with properties get off by anagraficaSupport object, those are all property of the properties definition list passed as parameter.     
 * /*from   w ww .  j  a  va2 s .c o m*/
 * 
 * @param <P>
 * @param <TP>
 * @param dto
 * @param anagraficaSupport
 * @param tipologie
 * @param nestedObjects
 */
public static <P extends Property<TP>, TP extends PropertiesDefinition> void fillDTO(IAnagraficaObjectDTO dto,
        AnagraficaSupport<P, TP> anagraficaSupport, List<TP> tipologie) {
    for (TP tipProprieta : tipologie) {
        dto.getAnagraficaProperties().put(tipProprieta.getShortName(), LazyList
                .decorate(new LinkedList<ValoreDTO>(), new AValoreDTOFactory(tipProprieta.getRendering())));

    }

    if (anagraficaSupport != null) {
        for (TP tipProprieta : tipologie) {
            List<ValoreDTO> avalori = new LinkedList<ValoreDTO>();
            // List<Object> avalori = new LinkedList<Object>();
            for (P proprieta : anagraficaSupport.getProprietaDellaTipologia(tipProprieta)) {
                ValoreDTO avaloredto = new ValoreDTO(proprieta.getValue().getObject(),
                        (proprieta.getVisibility() == 0) ? false : true);
                avaloredto.setLock(proprieta.getLockDef() == 0 ? false : true);
                avalori.add(avaloredto);

            }
            if (avalori.size() != 0) {
                dto.getAnagraficaProperties().get(tipProprieta.getShortName()).clear();
                dto.getAnagraficaProperties().get(tipProprieta.getShortName()).addAll(avalori);
            }
        }
    }

}

From source file:org.agnitas.web.RecipientForm.java

public RecipientForm() {
    updateButton = new ImageButton();
    deleteButton = new ImageButton();
    targetAddButton = new ImageButton();

    targetRemoveList = (List<ImageButton>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<ImageButton>(), imageButtonFactory));
    columnAndTypeList = (List<String>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<String>(), emptyStringFactory));
    chainOperatorList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    parenthesisOpenedList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    primaryOperatorList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    primaryValueList = (List<String>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<String>(), emptyStringFactory));
    parenthesisClosedList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    dateFormatList = (List<String>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<String>(), emptyStringFactory));
    secondaryOperatorList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    secondaryValueList = (List<String>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<String>(), emptyStringFactory));
    validTargetOperatorsList = (List<TargetOperator[]>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<TargetOperator[]>(), nullFactory));
    columnNameList = (List<String>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<String>(), emptyStringFactory));
    columnTypeList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    advancedSearchVisible = false;//from  w w  w . j a  v a2  s.  c o  m
    selectedFields = DEFAULT_FIELDS;
    selectedFieldsOld = DEFAULT_FIELDS;
}

From source file:org.agnitas.web.TargetForm.java

public TargetForm() {
    columnAndTypeList = (List<String>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<String>(), emptyStringFactory));
    chainOperatorList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    parenthesisOpenedList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    primaryOperatorList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    primaryValueList = (List<String>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<String>(), emptyStringFactory));
    parenthesisClosedList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    dateFormatList = (List<String>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<String>(), emptyStringFactory));
    secondaryOperatorList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
    secondaryValueList = (List<String>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<String>(), emptyStringFactory));
    validTargetOperatorsList = (List<TargetOperator[]>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<TargetOperator[]>(), nullFactory));
    columnNameList = (List<String>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<String>(), emptyStringFactory));
    columnTypeList = (List<Integer>) GrowthList
            .decorate(LazyList.decorate(new ArrayList<Integer>(), zeroIntegerFactory));
}

From source file:org.agnitas.web.UserFormEditForm.java

@Override
public void reset(ActionMapping map, HttpServletRequest request) {
    Factory factory = new Factory() {
        public Object create() {
            return new Integer(0);
        }/*  w w w  .  j av a2  s .co m*/
    };
    columnwidthsList = LazyList.decorate(new ArrayList(), factory);

}

From source file:org.diffkit.diff.sns.DKPoiSheet.java

@SuppressWarnings("unchecked")
private List<Type> discoverColumnTypes(List<Row> rows_) {
    if (CollectionUtils.isEmpty(rows_))
        return null;
    List<Type> columnTypes = GrowthList
            .decorate(LazyList.decorate(new ArrayList<Type>(), FactoryUtils.nullFactory()));
    int start = this.hasHeader() ? 1 : 0;
    for (int i = start; i < rows_.size(); i++) {
        Row aRow = rows_.get(i);//from  ww  w  .  j a va2  s .  co m
        int width = aRow.getLastCellNum();
        for (int j = 0; j < width; j++) {
            Cell cell = aRow.getCell(j);
            if (cell == null)
                continue;
            if (_isDebugEnabled) {
                _log.debug(String.format("cell->%s formatString->%s format->%s", cell.getColumnIndex(),
                        cell.getCellStyle().getDataFormatString(), cell.getCellStyle().getDataFormat()));
            }
            Type cellType = mapColumnType(cell);
            Type columnType = columnTypes.get(j);
            if (_isDebugEnabled)
                _log.debug("cellType->{} columnType->{}", cellType, columnType);
            if (columnType == null)
                columnTypes.set(j, cellType);
            else if (columnType != cellType)
                columnTypes.set(j, Type.MIXED);
        }
    }
    return columnTypes;
}