Java 类org.apache.commons.collections.ArrayStack 实例源码

项目:lams    文件:ProgressBuilder.java   
/**
    * Create the builder. Supply all the data that will be needed to parse the design..
    * 
    * If accessMode == LEARNER then progress and user must not be null. This will create a list of portfolio objects
    * for
    * all activities that the LEARNER has completed or attempted.
    * 
    * If accessMode == AUTHOR then progress and user must not be null and a few hacks must be done to let the user skip
    * ahead (to be done).
    * 
    * In all cases, all activities are included, whether they are started or not.
    * 
    * @param design
    * @param activityDAO
    * @param lamsCoreToolService
    * @param accessMode
    * @param lesson
    * @param progress
    * @param user
    */
   public ProgressBuilder(LearnerProgress progress, IActivityDAO activityDAO, ActivityMapping activityMapping) {
super(progress.getLesson().getLearningDesign(), activityDAO);
this.user = progress.getUser();
this.progress = progress;
this.activityMapping = activityMapping;

this.mainActivityList = new ArrayList<ActivityURL>();
this.currentActivityList = mainActivityList;

this.activityListStack = new ArrayStack(5);

Lesson lesson = progress.getLesson();
previewMode = lesson.isPreviewLesson();
isFloating = false;
//if ( previewMode ) {
// setup the basic call to the learner screen, ready just to put the activity id on the end. Saves calculating it for every activity
this.forceLearnerURL = "learner.do?method=forceMoveRedirect&lessonID=" + progress.getLesson().getLessonId()
    + "&destActivityID=";
//}

   }
项目:cloud-meter    文件:FileServer.java   
/**
 * Calculates the relative path from {@link #DEFAULT_BASE} to the current base,
 * which must be the same as or a child of the default.
 * 
 * @return the relative path, or {@code "."} if the path cannot be determined
 */
public synchronized File getBaseDirRelative() {
    // Must first convert to absolute path names to ensure parents are available
    File parent = new File(DEFAULT_BASE).getAbsoluteFile();
    File f = base.getAbsoluteFile();
    ArrayStack l = new ArrayStack();
    while (f != null) { 
        if (f.equals(parent)){
            if (l.isEmpty()){
                break;
            }
            File rel = new File((String) l.pop());
            while(!l.isEmpty()) {
                rel = new File(rel, (String) l.pop());
            }
            return rel;
        }
        l.push(f.getName());
        f = f.getParentFile(); 
    }
    return new File(".");
}
项目:incubator-atlas    文件:EntityLineageServiceTest.java   
private void createTable(String tableName, int numCols, boolean createLineage) throws Exception {
    String dbId = getEntityId(DATABASE_TYPE, "name", "Sales");
    Id salesDB = new Id(dbId, 0, DATABASE_TYPE);

    //Create the entity again and schema should return the new schema
    List<Referenceable> columns = new ArrayStack();
    for (int i = 0; i < numCols; i++) {
        columns.add(column("col" + random(), "int", "column descr"));
    }

    Referenceable sd =
            storageDescriptor("hdfs://host:8000/apps/warehouse/sales", "TextInputFormat", "TextOutputFormat", true,
                    ImmutableList.of(column("time_id", "int", "time id")));

    Id table = table(tableName, "test table", salesDB, sd, "fetl", "External", columns);
    if (createLineage) {
        Id inTable = table("table" + random(), "test table", salesDB, sd, "fetl", "External", columns);
        Id outTable = table("table" + random(), "test table", salesDB, sd, "fetl", "External", columns);
        loadProcess("process" + random(), "hive query for monthly summary", "Tim ETL", ImmutableList.of(inTable),
                ImmutableList.of(table), "create table as select ", "plan", "id", "graph", "ETL");
        loadProcess("process" + random(), "hive query for monthly summary", "Tim ETL", ImmutableList.of(table),
                ImmutableList.of(outTable), "create table as select ", "plan", "id", "graph", "ETL");
    }
}
项目:incubator-atlas    文件:DataSetLineageServiceTest.java   
private void createTable(String tableName, int numCols, boolean createLineage) throws Exception {
    String dbId = getEntityId(DATABASE_TYPE, "name", "Sales");
    Id salesDB = new Id(dbId, 0, DATABASE_TYPE);

    //Create the entity again and schema should return the new schema
    List<Referenceable> columns = new ArrayStack();
    for (int i = 0; i < numCols; i++) {
        columns.add(column("col" + random(), "int", "column descr"));
    }

    Referenceable sd =
            storageDescriptor("hdfs://host:8000/apps/warehouse/sales", "TextInputFormat", "TextOutputFormat", true,
                    ImmutableList.of(column("time_id", "int", "time id")));

    Id table = table(tableName, "test table", salesDB, sd, "fetl", "External", columns);
    if (createLineage) {
        Id inTable = table("table" + random(), "test table", salesDB, sd, "fetl", "External", columns);
        Id outTable = table("table" + random(), "test table", salesDB, sd, "fetl", "External", columns);
        loadProcess("process" + random(), "hive query for monthly summary", "Tim ETL", ImmutableList.of(inTable),
                ImmutableList.of(table), "create table as select ", "plan", "id", "graph", "ETL");
        loadProcess("process" + random(), "hive query for monthly summary", "Tim ETL", ImmutableList.of(table),
                ImmutableList.of(outTable), "create table as select ", "plan", "id", "graph", "ETL");
    }
}
项目:apache-jmeter-2.10    文件:FileServer.java   
/**
 * Calculates the relative path from {@link #DEFAULT_BASE} to the current base,
 * which must be the same as or a child of the default.
 * 
 * @return the relative path, or {@code "."} if the path cannot be determined
 */
public synchronized File getBaseDirRelative() {
    // Must first convert to absolute path names to ensure parents are available
    File parent = new File(DEFAULT_BASE).getAbsoluteFile();
    File f = base.getAbsoluteFile();
    ArrayStack l = new ArrayStack();
    while (f != null) { 
        if (f.equals(parent)){
            if (l.isEmpty()){
                break;
            }
            File rel = new File((String) l.pop());
            while(!l.isEmpty()) {
                rel = new File(rel, (String) l.pop());
            }
            return rel;
        }
        l.push(f.getName());
        f = f.getParentFile(); 
    }
    return new File(".");
}
项目:lams    文件:EmailProgressActivitiesProcessor.java   
public EmailProgressActivitiesProcessor(LearningDesign design, IActivityDAO activityDAO, Map<Long, Integer> numberOfUsersInActivity) {
super(design, activityDAO);
this.numberOfUsersInActivity = numberOfUsersInActivity;
this.activityList = new Vector<EmailProgressActivityDTO>();
this.activityListStack = new ArrayStack(5);
this.currentActivityList = activityList;
depth=0;
   }
项目:lams    文件:ContributeActivitiesProcessor.java   
public ContributeActivitiesProcessor(LearningDesign design, Long lessonID, IActivityDAO activityDAO,
    ILamsCoreToolService toolService) {
super(design, activityDAO);
this.lessonID = lessonID;
this.toolService = toolService;
this.mainActivityList = new Vector<ContributeActivityDTO>();
this.activityListStack = new ArrayStack(5);
this.currentActivityList = mainActivityList;
   }
项目:venus    文件:BeanPropertySetterRule.java   
public void begin(String namespace, String name, Attributes attributes) throws Exception {
    if (attrname != null) {
        attrvalue = attributes.getValue(attrname);
    }
    ArrayStack stack = threadLocal.get();
    stack.push(attrvalue);
    super.begin(namespace, name, attributes);
}
项目:venus    文件:BeanPropertySetterRule.java   
public void end(String namespace, String name) throws Exception {

        super.propertyName = attrvalue;

        end0(namespace, name);
        ArrayStack stack = threadLocal.get();
        stack.pop();
    }
项目:appstatus    文件:ServiceMonitorLocator.java   
public static IServiceMonitor getCurrentServiceMonitor() {
    ArrayStack stack = monitorStack.get();

    if (!stack.isEmpty()) {
        return (IServiceMonitor) stack.peek();
    }

    return null;
}
项目:venus    文件:BeanPropertySetterRule.java   
protected ArrayStack initialValue() {
    return new ArrayStack();
}
项目:appstatus    文件:ServiceMonitorLocator.java   
@Override
protected ArrayStack initialValue() {
    return new ArrayStack();
}
项目:appstatus    文件:ServiceMonitorLocator.java   
public static ArrayStack getServiceMonitorStack() {
    return monitorStack.get();
}