org.apache.commons.collections.ArrayStack Java Examples

The following examples show how to use org.apache.commons.collections.ArrayStack. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProgressBuilder.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
    * 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 = "learning/learner/forceMoveRedirect.do?lessonID=" + progress.getLesson().getLessonId()
	+ "&destActivityID=";
//}

   }
 
Example #2
Source File: EntityLineageServiceTest.java    From incubator-atlas with Apache License 2.0 6 votes vote down vote up
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");
    }
}
 
Example #3
Source File: DataSetLineageServiceTest.java    From incubator-atlas with Apache License 2.0 6 votes vote down vote up
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");
    }
}
 
Example #4
Source File: EmailProgressActivitiesProcessor.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
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;
   }
 
Example #5
Source File: ContributeActivitiesProcessor.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
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;
   }
 
Example #6
Source File: ServiceMonitorLocator.java    From appstatus with Apache License 2.0 5 votes vote down vote up
public static IServiceMonitor getCurrentServiceMonitor() {
	ArrayStack stack = monitorStack.get();

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

	return null;
}
 
Example #7
Source File: ServiceMonitorLocator.java    From appstatus with Apache License 2.0 4 votes vote down vote up
@Override
protected ArrayStack initialValue() {
	return new ArrayStack();
}
 
Example #8
Source File: ServiceMonitorLocator.java    From appstatus with Apache License 2.0 4 votes vote down vote up
public static ArrayStack getServiceMonitorStack() {
	return monitorStack.get();
}