当前位置: 首页>>代码示例>>Java>>正文


Java Aggregate类代码示例

本文整理汇总了Java中org.stringtemplate.v4.misc.Aggregate的典型用法代码示例。如果您正苦于以下问题:Java Aggregate类的具体用法?Java Aggregate怎么用?Java Aggregate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Aggregate类属于org.stringtemplate.v4.misc包,在下文中一共展示了Aggregate类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addAggr

import org.stringtemplate.v4.misc.Aggregate; //导入依赖的package包/类
/** Split {@code aggrName.{propName1,propName2}} into list
 *  {@code [propName1, propName2]} and the {@code aggrName}. Spaces are
 *  allowed around {@code ','}.
 */

public synchronized ST addAggr(String aggrSpec, Object... values) {
    int dot = aggrSpec.indexOf(".{");
    if ( values==null || values.length==0 ) {
        throw new IllegalArgumentException("missing values for aggregate attribute format: "+aggrSpec);
    }

    int finalCurly = aggrSpec.indexOf('}');
    if ( dot<0 || finalCurly<0 ) {
        throw new IllegalArgumentException("invalid aggregate attribute format: "+aggrSpec);
    }

    String aggrName = aggrSpec.substring(0, dot);
    String propString = aggrSpec.substring(dot +2, aggrSpec.length()-1);
    propString = propString.trim();
    String[] propNames = propString.split("\\ *,\\ *");
    if ( propNames==null || propNames.length==0 ) {
        throw new IllegalArgumentException("invalid aggregate attribute format: "+aggrSpec);
    }

    if ( values.length!= propNames.length ) {
        throw new IllegalArgumentException("number of properties and values mismatch for aggregate attribute format: "+aggrSpec);
    }

    int i = 0;
    Aggregate aggr = new Aggregate();
    for (String p : propNames) {
        Object v = values[i++];
        aggr.properties.put(p, v);
    }
    add(aggrName, aggr); // now add as usual
    return this;
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:38,代码来源:ST.java

示例2: addAggr

import org.stringtemplate.v4.misc.Aggregate; //导入依赖的package包/类
/** Split {@code aggrName.{propName1,propName2}} into list
 *  {@code [propName1, propName2]} and the {@code aggrName}. Spaces are
 *  allowed around {@code ','}.
 */

public synchronized ST addAggr(String aggrSpec, Object ... values) {
    int dot = aggrSpec.indexOf(".{");
    if ( values==null || values.length==0 ) {
        throw new IllegalArgumentException("missing values for aggregate attribute format: "+aggrSpec);
    }

    int finalCurly = aggrSpec.indexOf('}');
    if ( dot<0 || finalCurly<0 ) {
        throw new IllegalArgumentException("invalid aggregate attribute format: "+aggrSpec);
    }

    String aggrName = aggrSpec.substring(0, dot);
    String propString = aggrSpec.substring(dot+2, aggrSpec.length()-1);
    propString = propString.trim();
    String[] propNames = propString.split("\\ *,\\ *");
    if ( propNames==null || propNames.length==0 ) {
        throw new IllegalArgumentException("invalid aggregate attribute format: "+aggrSpec);
    }

    if ( values.length!= propNames.length ) {
        throw new IllegalArgumentException("number of properties and values mismatch for aggregate attribute format: "+aggrSpec);
    }

    int i = 0;
    Aggregate aggr = new Aggregate();
    for (String p : propNames) {
        Object v = values[i++];
        aggr.properties.put(p, v);
    }
    add(aggrName, aggr); // now add as usual
    return this;
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:38,代码来源:ST.java

示例3: addAggr

import org.stringtemplate.v4.misc.Aggregate; //导入依赖的package包/类
/** Split {@code aggrName.{propName1,propName2}} into list
 *  {@code [propName1, propName2]} and the {@code aggrName}. Spaces are
 *  allowed around {@code ','}.
 */

public synchronized ST addAggr(String aggrSpec, Object ... values) {
    int dot = aggrSpec.indexOf(".{");
    if ( values==null || values.length==0 ) {
        throw new IllegalArgumentException("missing values for aggregate attribute format: "+
                                               aggrSpec);
    }

    int finalCurly = aggrSpec.indexOf('}');
    if ( dot<0 || finalCurly<0 ) {
        throw new IllegalArgumentException("invalid aggregate attribute format: "+
                                               aggrSpec);
    }

    String aggrName = aggrSpec.substring(0, dot);
    String propString = aggrSpec.substring(dot+2, aggrSpec.length()-1);
    propString = propString.trim();
    String[] propNames = propString.split("\\ *,\\ *");
    if ( propNames==null || propNames.length==0 ) {
        throw new IllegalArgumentException("invalid aggregate attribute format: "+
                                               aggrSpec);
    }

    if ( values.length!=propNames.length ) {
        throw new IllegalArgumentException("number of properties and values mismatch for aggregate attribute format: "+aggrSpec);
    }

    int i = 0;
    Aggregate aggr = new Aggregate();
    for (String p : propNames) {
        Object v = values[i++];
        aggr.properties.put(p, v);
    }
    add(aggrName, aggr); // now add as usual
    return this;
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:41,代码来源:ST.java

示例4: addAggr

import org.stringtemplate.v4.misc.Aggregate; //导入依赖的package包/类
/** Split {@code aggrName.{propName1,propName2}} into list
 *  {@code [propName1, propName2]} and the {@code aggrName}. Spaces are
 *  allowed around {@code ','}.
 */

public synchronized ST addAggr(String aggrSpec, Object ... values) {
    int dot = aggrSpec.indexOf(".{");
    if ( values==null || values.length==0 ) {
        throw new IllegalArgumentException("missing values for aggregate attribute format: "+
                                               aggrSpec);
    }

    int finalCurly = aggrSpec.indexOf('}');
    if ( dot<0 || finalCurly<0 ) {
        throw new IllegalArgumentException("invalid aggregate attribute format: "+
                                               aggrSpec);
    }

    String aggrName = aggrSpec.substring(0, dot);
    String propString = aggrSpec.substring(dot+2, aggrSpec.length()-1);
    propString = propString.trim();
    String[] propNames = propString.split("\\ *,\\ *");
    if ( propNames==null || propNames.length==0 ) {
        throw new IllegalArgumentException("invalid aggregate attribute format: "+
                                               aggrSpec);
    }

    if ( values.length!= propNames.length ) {
        throw new IllegalArgumentException("number of properties and values mismatch for aggregate attribute format: "+aggrSpec);
    }

    int i = 0;
    Aggregate aggr = new Aggregate();
    for (String p : propNames) {
        Object v = values[i++];
        aggr.properties.put(p, v);
    }
    add(aggrName, aggr); // now add as usual
    return this;
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:41,代码来源:ST.java

示例5: addAggr

import org.stringtemplate.v4.misc.Aggregate; //导入依赖的package包/类
/** Split {@code aggrName.{propName1,propName2}} into list
 *  {@code [propName1, propName2]} and the {@code aggrName}. Spaces are
 *  allowed around {@code ','}.
 */

public synchronized ST addAggr(String aggrSpec,Object ... values) {
    int dot = aggrSpec.indexOf(".{");
    if ( values==null || values.length==0 ) {
        throw new IllegalArgumentException("missing values for aggregate attribute format: "+aggrSpec);
    }

    int finalCurly = aggrSpec.indexOf('}');
    if ( dot<0 || finalCurly<0 ) {
        throw new IllegalArgumentException("invalid aggregate attribute format: "+
                                               aggrSpec);
    }

    String aggrName = aggrSpec.substring(0, dot);
    String propString = aggrSpec.substring(dot+2, aggrSpec.length()-1);
    propString = propString.trim();
    String[] propNames = propString.split("\\ *,\\ *");
    if ( propNames==null || propNames.length==0 ) {
        throw new IllegalArgumentException("invalid aggregate attribute format: "+
                                               aggrSpec);
    }

    if ( values.length!= propNames.length ) {
        throw new IllegalArgumentException("number of properties and values mismatch for aggregate attribute format: "+aggrSpec);
    }

    int i = 0;
    Aggregate aggr = new Aggregate();
    for (String p : propNames) {
        Object v = values[i++];
        aggr.properties.put(p, v);
    }
    add(aggrName, aggr); // now add as usual
    return this;
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:40,代码来源:ST.java

示例6: addAggr

import org.stringtemplate.v4.misc.Aggregate; //导入依赖的package包/类
/** Split {@code aggrName.{propName1,propName2}} into list
 *  {@code [propName1, propName2]} and the {@code aggrName}. Spaces are
 *  allowed around {@code ','}.
 */
public synchronized ST addAggr(String aggrSpec, Object... values) {
	int dot = aggrSpec.indexOf(".{");
	if ( values==null || values.length==0 ) {
		throw new IllegalArgumentException("missing values for aggregate attribute format: "+
										   aggrSpec);
	}
	int finalCurly = aggrSpec.indexOf('}');
	if ( dot<0 || finalCurly < 0 ) {
		throw new IllegalArgumentException("invalid aggregate attribute format: "+
										   aggrSpec);
	}
	String aggrName = aggrSpec.substring(0, dot);
	String propString = aggrSpec.substring(dot+2, aggrSpec.length()-1);
	propString = propString.trim();
	String[] propNames = propString.split("\\ *,\\ *");
	if ( propNames==null || propNames.length==0 ) {
		throw new IllegalArgumentException("invalid aggregate attribute format: "+
										   aggrSpec);
	}
	if ( values.length != propNames.length ) {
		throw new IllegalArgumentException(
			"number of properties and values mismatch for aggregate attribute format: "+
			aggrSpec);
	}
	int i=0;
	Aggregate aggr = new Aggregate();
	for (String p : propNames) {
		Object v = values[i++];
		aggr.properties.put(p, v);
	}

	add(aggrName, aggr); // now add as usual
	return this;
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:39,代码来源:ST.java

示例7: addAggregateList

import org.stringtemplate.v4.misc.Aggregate; //导入依赖的package包/类
@Override
public void addAggregateList(String name, Map<String, Object> map) {
    Aggregate aggregate = new Aggregate();
    aggregate.properties = new HashMap<>(map);
    st.add(name, aggregate);
}
 
开发者ID:bengtmartensson,项目名称:IrpTransmogrifier,代码行数:7,代码来源:STItemCodeGenerator.java


注:本文中的org.stringtemplate.v4.misc.Aggregate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。