當前位置: 首頁>>代碼示例>>Java>>正文


Java ModelRepository類代碼示例

本文整理匯總了Java中fr.lip6.move.pnml.framework.utils.ModelRepository的典型用法代碼示例。如果您正苦於以下問題:Java ModelRepository類的具體用法?Java ModelRepository怎麽用?Java ModelRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ModelRepository類屬於fr.lip6.move.pnml.framework.utils包,在下文中一共展示了ModelRepository類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PnmlModel

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
public PnmlModel() {
    super();
    model = null;
    doc = null;
    try {
        ModelRepository.getInstance().createDocumentWorkspace("main_workspace");
        doc = new PetriNetDocHLAPI();
        model = new PetriNetHLAPI("main_net", PNTypeHLAPI.PTNET, new NameHLAPI("main_net"), doc);
    } catch (InvalidIDException | VoidRepositoryException e) {
    }
}
 
開發者ID:pascalpoizat,項目名稱:fmt,代碼行數:12,代碼來源:PnmlModel.java

示例2: fromPNML

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
@Override
@SuppressWarnings("unchecked")
public void fromPNML(OMElement locRoot, IdRefLinker idr) throws InnerBuildException, InvalidIDException,
		VoidRepositoryException {
	//1
	//0
	//1
	//0
	@SuppressWarnings("unused")
	ArbitrarydeclarationsFactory fact = ArbitrarydeclarationsFactory.eINSTANCE;

	//processing id

	if (locRoot.getAttributeValue(new QName("id")) != null) {
		this.setId(new java.lang.String(locRoot.getAttributeValue(new QName("id"))));
		ModelRepository.getInstance().getCurrentIdRepository()
				.checkId(new java.lang.String(locRoot.getAttributeValue(new QName("id"))).toString(), this);
	}

	//processing idref

	//processing attributes

	if (locRoot.getAttributeValue(new QName("name")) != null) {
		try {
			this.setName(new String(locRoot.getAttributeValue(new QName("name"))));
		} catch (Exception e) {
			throw new fr.lip6.move.pnml.framework.utils.exception.InnerBuildException(e);
		}
	}

	//processing sons

}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:35,代碼來源:ArbitrarySortImpl.java

示例3: modelToFile

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
@Override
public void modelToFile(AbstractModel model) throws IOException, IllegalResourceException, IllegalModelException {
    checkModel(model, PnmlModel.class);
    PnmlModel pnmlModel = (PnmlModel) model;
    ModelRepository mr = ModelRepository.getInstance();
    mr.setPrettyPrintStatus(true);
    FileWriter fw = new FileWriter(pnmlModel.getResource().getAbsolutePath());
    fw.write(pnmlModel.getDoc().toPNML());
    fw.close();
}
 
開發者ID:pascalpoizat,項目名稱:fmt,代碼行數:11,代碼來源:PnmlPnmlWriter.java

示例4: toPNML

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
 * Return the string containing the pnml output
 */
@Override
public String toPNML() {
	//id 0
	//idref 0
	//attributes 0
	//sons 0

	Boolean prettyPrintStatus = ModelRepository.getInstance().isPrettyPrintActive();
	String retline = "";
	String headline = "";
	PrettyPrintData prpd = null;
	if (prettyPrintStatus) {
		retline = "\n";
		prpd = ModelRepository.getInstance().getPrettyPrintData();
		headline = prpd.getCurrentLineHeader();
	}

	StringBuilder sb = new StringBuilder();
	sb.append(headline);
	sb.append("<integer");
	if (prettyPrintStatus) {
		headline = prpd.increaseLineHeaderLevel();
	}
	//begin attributes, id and id ref processing

	sb.append("/>");
	sb.append(retline);

	//sons, follow processing

	/****/

	if (prettyPrintStatus) {
		headline = prpd.decreaseLineHeaderLevel();
	}

	return sb.toString();
}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:42,代碼來源:HLIntegerImpl.java

示例5: toPNML

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
 * Return the string containing the pnml output
 */
@Override
public String toPNML() {
	//id 0
	//idref 0
	//attributes 0
	//sons 0

	Boolean prettyPrintStatus = ModelRepository.getInstance().isPrettyPrintActive();
	String retline = "";
	String headline = "";
	PrettyPrintData prpd = null;
	if (prettyPrintStatus) {
		retline = "\n";
		prpd = ModelRepository.getInstance().getPrettyPrintData();
		headline = prpd.getCurrentLineHeader();
	}

	StringBuilder sb = new StringBuilder();
	sb.append(headline);
	sb.append("<dot");
	if (prettyPrintStatus) {
		headline = prpd.increaseLineHeaderLevel();
	}
	//begin attributes, id and id ref processing

	sb.append("/>");
	sb.append(retline);

	//sons, follow processing

	/****/

	if (prettyPrintStatus) {
		headline = prpd.decreaseLineHeaderLevel();
	}

	return sb.toString();
}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:42,代碼來源:DotImpl.java

示例6: FEConstantHLAPI

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
 * this constructor allows you to set all 'settable' values
 * excepted container.
 */

public FEConstantHLAPI(
	 java.lang.String id

	, java.lang.String name
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
	FiniteEnumerationsFactory fact = FiniteEnumerationsFactoryImpl.eINSTANCE;
	synchronized(fact){item = fact.createFEConstant();}

		
		if(id!=null){
		
			item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
		}
	

		
		if(name!=null){
		
			item.setName(name);
		}
	

}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:29,代碼來源:FEConstantHLAPI.java

示例7: toPNML

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
 * Return the string containing the pnml output
 */
@Override
public void toPNML(FileChannel fc) {
	//id 0
	//idref 0
	//attributes 0
	//sons 0

	final int bufferSizeKB = 8;
	final int bufferSize = bufferSizeKB * 1024;
	final ByteBuffer bytebuf = ByteBuffer.allocateDirect(bufferSize);
	final String charsetEncoding = PNMLEncoding.ISO_8859_1.getName();

	Boolean prettyPrintStatus = ModelRepository.getInstance().isPrettyPrintActive();
	String retline = "";
	String headline = "";
	PrettyPrintData prpd = null;
	if (prettyPrintStatus) {
		retline = "\n";
		prpd = ModelRepository.getInstance().getPrettyPrintData();
		headline = prpd.getCurrentLineHeader();
	}

	StringBuilder sb = new StringBuilder();
	sb.append(headline);
	sb.append("<string");
	if (prettyPrintStatus) {
		headline = prpd.increaseLineHeaderLevel();
	}
	//begin attributes, id and id ref processing

	sb.append("/>");
	sb.append(retline);

	//sons, follow processing

	/****/

	if (prettyPrintStatus) {
		headline = prpd.decreaseLineHeaderLevel();
	}

	try {
		writeIntoStream(bytebuf, fc, sb.toString().getBytes(Charset.forName(charsetEncoding)));
	} catch (IOException io) {
		io.printStackTrace();
		// fail fast
		return;
	}
	sb = null;
}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:54,代碼來源:HLPNStringImpl.java

示例8: toPNML

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
 * Return the string containing the pnml output
 */
@Override
public String toPNML() {
	//id 0
	//idref 0
	//attributes 2
	//sons 0

	Boolean prettyPrintStatus = ModelRepository.getInstance().isPrettyPrintActive();
	String retline = "";
	String headline = "";
	PrettyPrintData prpd = null;
	if (prettyPrintStatus) {
		retline = "\n";
		prpd = ModelRepository.getInstance().getPrettyPrintData();
		headline = prpd.getCurrentLineHeader();
	}

	StringBuilder sb = new StringBuilder();
	sb.append(headline);
	sb.append("<position");
	if (prettyPrintStatus) {
		headline = prpd.increaseLineHeaderLevel();
	}
	//begin attributes, id and id ref processing

	if (getX() != null) {
		sb.append(" x");
		sb.append("=\"");
		sb.append(getX());
		sb.append("\"");
	}

	if (getY() != null) {
		sb.append(" y");
		sb.append("=\"");
		sb.append(getY());
		sb.append("\"");
	}

	sb.append("/>");
	sb.append(retline);

	//sons, follow processing

	/****/

	if (prettyPrintStatus) {
		headline = prpd.decreaseLineHeaderLevel();
	}

	return sb.toString();
}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:56,代碼來源:PositionImpl.java

示例9: TransitionHLAPI

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
   * This constructor give access to required stuff only (and container)
   */
public TransitionHLAPI(
	 java.lang.String id

	, PageHLAPI containerPage
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
	PnmlcoremodelFactory fact = PnmlcoremodelFactoryImpl.eINSTANCE;
	synchronized(fact){item = fact.createTransition();}

		
		if(id!=null){
		
			item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
		}
	

		
		if(containerPage!=null)
		item.setContainerPage((Page)containerPage.getContainedItem());
	

}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:25,代碼來源:TransitionHLAPI.java

示例10: setup

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
@BeforeMethod(groups = { "PetriNetHLAPI", "hlapi" })
public void setup() throws Exception{
//ModelRepository.reset(); ModelRepository.getInstance().createDocumentWorkspace("void");
ModelRepository mr = ModelRepository.getInstance();
mr.createDocumentWorkspace("void");

		itemid = new String("unid");
		
	itemtype = PNTypeHLAPI.get(0);
	
		
		//HlcorestructureFactoryImpl
		itemname = new NameHLAPI(new HlcorestructureFactoryImpl().createName());
		
	


	
	itemcontainerPetriNetDoc = new PetriNetDocHLAPI(new HlcorestructureFactoryImpl().createPetriNetDoc());
	

}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:23,代碼來源:PetriNetHLAPITest.java

示例11: toPNML

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
 * Return the string containing the pnml output
 */
@Override
public String toPNML() {
	//id 0
	//idref 0
	//attributes 0
	//sons 1

	Boolean prettyPrintStatus = ModelRepository.getInstance().isPrettyPrintActive();
	String retline = "";
	String headline = "";
	PrettyPrintData prpd = null;
	if (prettyPrintStatus) {
		retline = "\n";
		prpd = ModelRepository.getInstance().getPrettyPrintData();
		headline = prpd.getCurrentLineHeader();
	}

	StringBuilder sb = new StringBuilder();
	sb.append(headline);
	sb.append("<stringconcatenation");
	if (prettyPrintStatus) {
		headline = prpd.increaseLineHeaderLevel();
	}
	//begin attributes, id and id ref processing

	boolean haveSons = false;
	sb.append(">");
	sb.append(retline);

	//sons, follow processing

	if (getSubterm() != null) {

		java.util.List<fr.lip6.move.pnml.hlpn.terms.Term> items = getSubterm();
		for (Iterator<Term> iterator = items.iterator(); iterator.hasNext();) {
			Term item = iterator.next();

			sb.append(headline);
			sb.append("<");
			sb.append("subterm");
			sb.append(">");
			sb.append(item.toPNML());
			sb.append(headline);
			sb.append("</");
			sb.append("subterm");
			sb.append(">");

			haveSons = true;
		}

	}

	/****/

	if (prettyPrintStatus) {
		headline = prpd.decreaseLineHeaderLevel();
	}

	if (haveSons) {
		sb.append(headline);
		sb.append("</stringconcatenation>");
		sb.append(retline);
	} else {
		sb.delete(sb.lastIndexOf(">"), sb.length());
		sb.append("/>");
	}

	return sb.toString();
}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:73,代碼來源:ConcatenationImpl.java

示例12: ArbitrarySortHLAPI

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
 * this constructor allows you to set all 'settable' values
 * excepted container.
 */

public ArbitrarySortHLAPI(
	 java.lang.String id

	, java.lang.String name
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
	ArbitrarydeclarationsFactory fact = ArbitrarydeclarationsFactoryImpl.eINSTANCE;
	synchronized(fact){item = fact.createArbitrarySort();}

		
		if(id!=null){
		
			item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
		}
	

		
		if(name!=null){
		
			item.setName(name);
		}
	

}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:29,代碼來源:ArbitrarySortHLAPI.java

示例13: setIdHLAPI

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
 * set Id
 */
public void setIdHLAPI(

java.lang.String elem) throws InvalidIDException ,VoidRepositoryException   {


	if(elem!=null){
	
		try{
		item.setId(ModelRepository.getInstance().getCurrentIdRepository().changeId(this, elem));
		}catch (OtherException e){
		ModelRepository.getInstance().getCurrentIdRepository().checkId(elem, this);
		}
	}

}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:19,代碼來源:PartitionHLAPI.java

示例14: PageHLAPI

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
   * This constructor give access to required stuff only (and container)
   */
public PageHLAPI(
	 java.lang.String id

	, PageHLAPI containerPage
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
	PtnetFactory fact = PtnetFactoryImpl.eINSTANCE;
	synchronized(fact){item = fact.createPage();}

		
		if(id!=null){
		
			item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
		}
	

		
		if(containerPage!=null)
		item.setContainerPage((Page)containerPage.getContainedItem());
	

}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:25,代碼來源:PageHLAPI.java

示例15: tearDown

import fr.lip6.move.pnml.framework.utils.ModelRepository; //導入依賴的package包/類
/**
 * @throws java.lang.Exception
 */
@AfterMethod(groups = { "pnmltypetests" })
public void tearDown() throws Exception {
    ModelRepository.getInstance().destroyCurrentWorkspace();
}
 
開發者ID:lip6,項目名稱:pnmlframework,代碼行數:8,代碼來源:PNMLtypesTest.java


注:本文中的fr.lip6.move.pnml.framework.utils.ModelRepository類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。