lockcomposer.java

来自「一个完整的XACML工程,学习XACML技术的好例子!」· Java 代码 · 共 48 行

JAVA
48
字号
/*
 * lockComposer.java
 *
 * Created on 27 July 2006, 21:50
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package uk.ac.kent.dpa.util;

/**
 *
 * @author ls97
 */
public class LockComposer {
    
    private String dbURL;
    private String[] attributes;
    private int[] types;
    
    private static int READ = 0;
    private static int WRITE = 1;
    
    /** Creates a new instance of lockComposer */
    public LockComposer(String dbURLIn,String[] attrsIn, int[] typesIn) {
        this.dbURL=dbURLIn;
        this.attributes=attrsIn;
        this.types=typesIn;
    }
    
    public String getDbURL() {
        return this.dbURL;
    }
    
    public String compose() {
        String res = new String();
        String t;
        for (int i=0; i<this.attributes.length; i++) {
            if (this.types[i]==0) t = new String("READ");
            else t = new String("WRITE");
            if (i<this.attributes.length-1) res += this.attributes[i]+" "+t+",";
            else res += this.attributes[i]+" "+t;
        }
        return res;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?