當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。