当前位置: 首页>>代码示例>>Java>>正文


Java Book.setTitle方法代码示例

本文整理汇总了Java中org.eclipse.emf.examples.extlibrary.Book.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Book.setTitle方法的具体用法?Java Book.setTitle怎么用?Java Book.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.emf.examples.extlibrary.Book的用法示例。


在下文中一共展示了Book.setTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: capitalize

import org.eclipse.emf.examples.extlibrary.Book; //导入方法依赖的package包/类
private void capitalize(Book book) {
	if (book != null) {
		if (book.getTitle().equals(book.getTitle().toUpperCase())) {
			book.setTitle(book.getTitle().toLowerCase());
		} else {
			book.setTitle(book.getTitle().toUpperCase());
		}
	}
}
 
开发者ID:mbarbero,项目名称:econ-na-2014-emf-edit,代码行数:10,代码来源:DemoSWT.java

示例2: init

import org.eclipse.emf.examples.extlibrary.Book; //导入方法依赖的package包/类
private void init() {
	factory = EXTLibraryFactory.eINSTANCE;
	library = factory.createLibrary();
	library.setName("Alexandria");
	library.setAddress("Alexandria, Egypt");
	
	Writer tolkien = factory.createWriter();
	tolkien.setFirstName("J.R.R.");
	tolkien.setLastName("Tolkien");
	library.getWriters().add(tolkien);
	
	Book book = factory.createBook();
	book.setTitle("The Lord of the Ring — The Fellowship of the Ring");
	book.setCategory(BookCategory.SCIENCE_FICTION_LITERAL);
	book.setPages(564);
	book.setAuthor(tolkien);
	Calendar pubdate = Calendar.getInstance();
	pubdate.set(1954, 6, 29);
	book.setPublicationDate(pubdate.getTime());
	library.getBooks().add(book);
	
	book = factory.createBook();
	book.setTitle("The Lord of the Ring — The Two Towers");
	book.setCategory(BookCategory.SCIENCE_FICTION_LITERAL);
	book.setPages(523);
	book.setAuthor(tolkien);
	pubdate = Calendar.getInstance();
	pubdate.set(1954, 10, 11);
	book.setPublicationDate(pubdate.getTime());
	library.getBooks().add(book);
	
	book = factory.createBook();
	book.setTitle("The Lord of the Ring — The Return of the King");
	book.setCategory(BookCategory.SCIENCE_FICTION_LITERAL);
	book.setPages(639);
	book.setAuthor(tolkien);
	pubdate = Calendar.getInstance();
	pubdate.set(1955, 9, 20);
	book.setPublicationDate(pubdate.getTime());
	library.getBooks().add(book);
	
	VideoCassette videoK7 = factory.createVideoCassette();
	videoK7.setTitle("Tapes are vintage, then they are hype");
	videoK7.setDamaged(true);
	videoK7.setCopies(3);
	pubdate = Calendar.getInstance();
	pubdate.set(1983, 3, 7);
	videoK7.setPublicationDate(pubdate.getTime());
	library.getStock().add(videoK7);

	resourceSet = new ResourceSetImpl();
	resource = new ResourceImpl(URI.createURI("demo.xmi"));
	resource.getContents().add(library);
	resourceSet.getResources().add(resource);

	ResourceImpl extlibraryEcore = new ResourceImpl(URI.createURI("extlibrary.ecore"));
	extlibraryEcore.getContents().add(EXTLibraryPackage.eINSTANCE);
	resourceSet.getResources().add(extlibraryEcore);
}
 
开发者ID:mbarbero,项目名称:econ-na-2014-emf-edit,代码行数:60,代码来源:MyLibrary.java

示例3: createBook

import org.eclipse.emf.examples.extlibrary.Book; //导入方法依赖的package包/类
public Book createBook(String title) {
	Book book = factory.createBook();
	book.setTitle(title);
	library.getBooks().add(book);
	return book;
}
 
开发者ID:mbarbero,项目名称:econ-na-2014-emf-edit,代码行数:7,代码来源:MyLibrary.java


注:本文中的org.eclipse.emf.examples.extlibrary.Book.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。