• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StringFormatter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: parseCast

import com.sun.javafx.binding.StringFormatter; //导入依赖的package包/类
/**
 * Parse cast instruction.
 * <pre>
 *     CastOps TypeAndValue 'to' Type
 * </pre>
 *
 * @param inst
 * @param pfs
 * @param opc
 * @return
 */
private boolean parseCast(OutParamWrapper<Instruction> inst,
        PerFunctionState pfs, Operator opc)
{
    OutParamWrapper<Value> val = new OutParamWrapper<>();
    OutParamWrapper<SMLoc> loc = new OutParamWrapper<>();
    OutParamWrapper<Type> ty = new OutParamWrapper<>();

    if (parseTypeAndValue(val, loc, pfs) || parseToken(kw_to,
            "expected a 'to' in cast op") || parseType(ty, false/*allow void*/))
        return true;

    Value op = val.get();
    Type destTy = ty.get();
    SMLoc opLoc = loc.get();
    if (!CastInst.castIsValid(opc, op, destTy))
    {
        CastInst.castIsValid(opc, op, destTy);
        return error(opLoc, StringFormatter.format("invalid type conversion from '%s' to '%s'",
                op.getType().getDescription(), destTy.getDescription()).getValue());
    }
    inst.set(CastInst.create(opc, op, destTy, "", null));
    return false;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:35,代码来源:LLParser.java


示例2: parseAssemblyFile

import com.sun.javafx.binding.StringFormatter; //导入依赖的package包/类
public static Module parseAssemblyFile(String filename, OutParamWrapper<SMDiagnostic> diag)
{
    MemoryBuffer f = MemoryBuffer.getFileOrSTDIN(filename);
    SourceMgr srcMgr = new SourceMgr();
    srcMgr.addNewSourceBuffer(f, new SMLoc());
    Module m = new Module(filename);

    if (f == null)
    {
        diag.set(srcMgr.getMessage(new SMLoc(),
                StringFormatter.format("Could not open input file '%s'\n", filename).getValue(),
                "fatal error"));
        return null;
    }

    LLParser parser = new LLParser(f, srcMgr, m, diag);
    if (parser.run())
    {
        return null;
    }
    return m;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:23,代码来源:Parser.java


示例3: handle

import com.sun.javafx.binding.StringFormatter; //导入依赖的package包/类
public void handle(RoutingContext context) {
     Log.l("Stay Download " + context.request().remoteAddress());
     if(AdminManager.isAdmin(context)) {
         int year = Integer.valueOf(context.request().getParam("year"));
         int month = Integer.valueOf(context.request().getParam("month"));
         int week = Integer.valueOf(context.request().getParam("week"));
         String date = StringFormatter.format("%4d-%02d-%02d", year, month, week).getValue();
         String fileName = null;
try {
	fileName = new String("잔류신청.xlsx".getBytes("UTF-8"), "ISO-8859-1");
} catch (UnsupportedEncodingException e) {
	e.printStackTrace();
}
context.response()
	.putHeader(HttpHeaders.CONTENT_DISPOSITION, "filename=" + fileName)
	.sendFile(residualDownload.readExcel(date));
context.response().close();
     }else{
         context.response().setStatusCode(400);
         context.response().end("You are Not Admin");
         context.response().close();
     }
 }
 
开发者ID:DSM-DMS,项目名称:DMS,代码行数:24,代码来源:ResidualDownloadRouter.java


示例4: getVal

import com.sun.javafx.binding.StringFormatter; //导入依赖的package包/类
public Value getVal(int id, Type ty, SMLoc loc)
{
    Value val =  id < numberedVals.size() ? numberedVals.get(id) : null;

    if (val == null)
    {
        if (forwardRefValIDs.containsKey(id))
            val = forwardRefValIDs.get(id).first;
    }

    if (val != null)
    {
        if (val.getType().equals(ty)) return val;
        if (ty.equals(LLVMContext.LabelTy))
            parser.error(loc, StringFormatter
                    .format("'%%%d' is not a basic block", id).toString());
        else
            parser.error(loc, StringFormatter.format("'%%%d' defined with type '%s'",
                    id, val.getType().getDescription()).getValue());
        return null;
    }

    if (!ty.isFirstClassType() && !(ty instanceof OpaqueType) &&
            !ty.equals(LLVMContext.LabelTy))
    {
        parser.error(loc, "invalid use of a non-first class type");
        return null;
    }


    // Otherwise, create a new forward reference for this value and remember it.
    Value fwdVal;
    if (ty.equals(LLVMContext.LabelTy))
        fwdVal = BasicBlock.createBasicBlock("", fn);
    else
        fwdVal = new Argument(ty,"", fn);

    forwardRefValIDs.put(id, Pair.get(fwdVal, loc));
    return fwdVal;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:41,代码来源:PerFunctionState.java


示例5: update

import com.sun.javafx.binding.StringFormatter; //导入依赖的package包/类
private void update() {
    if (!isEnabled()) {
        System.out.println("Failed to update sign at " + location.toVector().toString() + ", no sign found.");
        return;
    }
    Sign sign = (Sign) location.getBlock().getState();
    sign.setLine(0, JOIN_LINE);
    sign.setLine(1, StringFormatter.format(TYPE_LINE, type).getValue());
    sign.setLine(2, StringFormatter.format(IN_QUEUE_LINE, getPlayersInQueue()).getValue());
    sign.setLine(3, StringFormatter.format(IN_GAME_LINE, getPlayersInGame()).getValue());
    sign.update(true, false);
}
 
开发者ID:toonsevrin,项目名称:SimpleAPI,代码行数:13,代码来源:SignDisplay.java


示例6: format

import com.sun.javafx.binding.StringFormatter; //导入依赖的package包/类
private static String format(int num) {
    return StringFormatter.format("%-4d", num).getValue();
}
 
开发者ID:InnoFang,项目名称:Quantify,代码行数:4,代码来源:Quantify.java


示例7: getGlobalVal

import com.sun.javafx.binding.StringFormatter; //导入依赖的package包/类
private GlobalValue getGlobalVal(String name, Type ty, SMLoc loc)
{
    PointerType pty = ty instanceof PointerType?(PointerType)ty : null;
    if (pty == null)
    {
        error(loc, "global variable reference must have pointer type");
        return null;
    }

    // look this name up in the normal function symbol table.
    Value val = m.getValueSymbolTable().getValue(name);
    GlobalValue gv = val instanceof GlobalValue ? (GlobalValue)val : null;
    if (gv == null)
    {
        // if this a forward reference for the value, see if we already have
        // forward ref record.
        if (forwardRefVals.containsKey(name))
            gv = forwardRefVals.get(name).first;
    }

    if (gv != null)
    {
        if (gv.getType().equals(ty)) return gv;
        error(loc, StringFormatter.format("'@%s' defined with type '%s'",
                name, gv.getType().getDescription()).getValue());
    }

    // Otherwise, create a new forward references for the value.
    GlobalValue fwdVal;
    if (pty.getElementType() instanceof FunctionType)
    {
        FunctionType ft = (FunctionType)pty.getElementType();
        if (ft.getReturnType() instanceof OpaqueType)
        {
            error(loc, "function may not return opaque type");
            return null;
        }

        fwdVal = new Function(ft, LinkageType.ExternalLinkage, name, null);
    }
    else
    {
        fwdVal = new GlobalVariable(m, pty.getElementType(), false,
                LinkageType.ExternalLinkage, null, "", null, 0);
    }

    forwardRefVals.put(name, Pair.get(fwdVal, loc));
    return fwdVal;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:50,代码来源:LLParser.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EventTranslatorVararg类代码示例发布时间:2022-05-23
下一篇:
Java TopicFilter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap