本文整理汇总了Java中java.util.Vector.iterator方法的典型用法代码示例。如果您正苦于以下问题:Java Vector.iterator方法的具体用法?Java Vector.iterator怎么用?Java Vector.iterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Vector
的用法示例。
在下文中一共展示了Vector.iterator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadDrivers
import java.util.Vector; //导入方法依赖的package包/类
/**
* 装载和注册所有JDBC 驱动程序
*
* @param props 属性
*/
private void loadDrivers(Vector driverBeans) {
logger.debug("----------------------->");
Iterator iterator = driverBeans.iterator();
while (iterator.hasNext()) {
DSConfigBean dsConfigBean = (DSConfigBean)iterator.next();
try {
if (dsConfigBean.getDriver() != null && !"".equals(dsConfigBean.getDriver())){
Driver driver = (Driver) Class.forName(dsConfigBean.getDriver())
.newInstance();
DriverManager.registerDriver(driver);
drivers.addElement(driver);
logger.debug("成功注册JDBC 驱动程序" + dsConfigBean.getDriver());
}
} catch (Exception e) {
logger.error("注册驱动程序出错,",e);
}
}
}
示例2: ReflectClass
import java.util.Vector; //导入方法依赖的package包/类
/**
* Constructor for this class.
* @param clazz the class out of the ontology
* @param clazzSlots the list of slots defined in the vocabulary of an ontology
*/
public ReflectClass(Class<?> clazz, Hashtable<String, String> clazzSlots ){
currClass = clazz;
currClassSlots = clazzSlots;
currSlotList = new Slot[currClassSlots.size()];
int currSlotListCounter = -1;
Vector<String> v = new Vector<String>(currClassSlots.keySet());
Collections.sort(v);
Iterator<String> it = v.iterator();
while (it.hasNext()) {
// --- Slot der Klasse ermitteln und untersuchen -----
String key = it.next();
String word = currClassSlots.get(key);
Slot currSlot = new Slot(word);
currSlotListCounter++;
currSlotList[currSlotListCounter] = currSlot;
}
}
示例3: getProbabilityComponents
import java.util.Vector; //导入方法依赖的package包/类
/**
* Helper method to extract the probability components the dialog's
* components. These components are the probability labels and the
* probability TextFields.
*
* @return a Vector of probability related components
* @author Federico Dal Castello
*/
private Vector<Component> getProbabilityComponents() {
Vector<Component> probabilityComponents = new Vector<Component>();
Vector<Component> components = new Vector<Component>();
components.addAll(Arrays.asList(intervalPanels[1].getComponents()));
components.addAll(Arrays.asList(intervalPanels[2].getComponents()));
Iterator<Component> it = components.iterator();
while (it.hasNext()) {
Component comp = it.next();
if (comp instanceof JTextField) {
if (comp.getName().equals(PROBABILITY_INTERVAL_A)
|| comp.getName().equals(PROBABILITY_INTERVAL_B)) {
probabilityComponents.add(comp);
}
}
if (comp instanceof JLabel
&& ((JLabel) comp).getText().equals(PROBABILITY)) {
probabilityComponents.add(comp);
}
}
return probabilityComponents;
}
示例4: filterDataBase
import java.util.Vector; //导入方法依赖的package包/类
/**
*
* @param myFilter get filter
* @param dataBase to filter it
* filtering the database with the filter
*/
public static void filterDataBase(filter myFilter,Vector<sameScanWifi> dataBase){
for (Iterator<sameScanWifi> sameScanWifiIterator = dataBase.iterator(); sameScanWifiIterator.hasNext(); ) {
if(!myFilter.filters(sameScanWifiIterator.next())){
sameScanWifiIterator.remove();
}
}
}
示例5: getPropertyNames
import java.util.Vector; //导入方法依赖的package包/类
/**
* Returns an array of <code>String</code>s recognized as names by
* this property source that begin with the supplied prefix. If
* no property names match, <code>null</code> will be returned.
* The comparison is done in a case-independent manner.
*
* <p> The default implementation calls
* <code>getPropertyNames()</code> and searches the list of names
* for matches.
*
* @return an array of <code>String</code>s giving the valid
* property names.
*/
public String[] getPropertyNames(String prefix) {
String propertyNames[] = getPropertyNames();
if (propertyNames == null) {
return null;
}
prefix = prefix.toLowerCase();
Vector<String> names = new Vector<String>();
for (int i = 0; i < propertyNames.length; i++) {
if (propertyNames[i].startsWith(prefix)) {
names.addElement(propertyNames[i]);
}
}
if (names.size() == 0) {
return null;
}
// Copy the strings from the Vector over to a String array.
String prefixNames[] = new String[names.size()];
int count = 0;
for (Iterator<String> it = names.iterator(); it.hasNext(); ) {
prefixNames[count++] = it.next();
}
return prefixNames;
}
示例6: tagV
import java.util.Vector; //导入方法依赖的package包/类
void tagV(Vector<String> v) {
Iterator<String> i = v.iterator();
while(i.hasNext()) {
String name = i.next();
String data = i.next();
tagData(name, data);
}
}
示例7: removeAllProjectWindowTabsTemporary4Rebuilding
import java.util.Vector; //导入方法依赖的package包/类
/**
* This method removes all ProjectWindowTabs from the current display.
*/
private void removeAllProjectWindowTabsTemporary4Rebuilding() {
Vector<ProjectWindowTab> pwtVector = new Vector<ProjectWindowTab>(this.tabVector);
for (Iterator<ProjectWindowTab> it = pwtVector.iterator(); it.hasNext();) {
ProjectWindowTab pwt = it.next();
if (pwt.getCompForChildComp() != null) {
pwt.getCompForChildComp().removeAll();
}
}
this.getRootNode().removeAllChildren();
this.projectViewRightTabs.removeAll();
}
示例8: storeResponseMessages
import java.util.Vector; //导入方法依赖的package包/类
private void storeResponseMessages(String address, String messageId, Vector<String> messages,
String countryCode) throws MessageHandlingException {
xLogger.fine("Entered storeResponseMessages");
IMultipartMsg mmsg = JDOUtils.createInstance(IMultipartMsg.class);
mmsg.setId(JDOUtils.createMultipartMsgKey(address, messageId));
mmsg.setTimestamp(new Date());
mmsg.setCountry(countryCode);
Iterator<String> it = messages.iterator();
while (it.hasNext()) {
mmsg.addMessage(it.next());
}
com.logistimo.utils.MessageUtil.storeMultipartMsg(mmsg);
xLogger.fine("Exiting storeResponseMessages");
}
示例9: getColumnGroups
import java.util.Vector; //导入方法依赖的package包/类
/**
* Provides and iterator for accessing the ColumnGroups
* associated with a column.
*
* @param col Column
* @return ColumnGroup iterator
*/
@SuppressWarnings("unchecked")
public Iterator getColumnGroups(TableColumn col) {
if (columnGroups.isEmpty()) return null;
Iterator iter = columnGroups.iterator();
while (iter.hasNext()) {
ColumnGroup cGroup = (ColumnGroup) iter.next();
Vector v_ret = cGroup.getColumnGroups(col, new Vector());
if (v_ret != null) {
return v_ret.iterator();
}
}
return null;
}
示例10: startAgentsOnContainers
import java.util.Vector; //导入方法依赖的package包/类
/**
* start agents on their assigned locations.
*
* @param agentContainerList the agent container list
* @param verbose the verbose
* @return true, if successful
*/
protected boolean startAgentsOnContainers(Hashtable<Location, ArrayList<AgentClassElement4SimStart>> agentContainerList, boolean verbose){
if(agentContainerList != null){
/** all locations agents are mapped to*/
Vector<Location> locations = new Vector<Location>(agentContainerList.keySet());
/** iterator for locations*/
Iterator<Location> loctionIterator = locations.iterator();
while (loctionIterator.hasNext() == true) {
Location location = loctionIterator.next();
for (Iterator<AgentClassElement4SimStart> it = agentContainerList.get(location).iterator(); it.hasNext();) {
// --- Get the agent, which has to be started ------------
AgentClassElement4SimStart agent2Start = it.next();
// --- Check for start arguments -------------------------
Object[] startArgs = getStartArguments(agent2Start);
// --- finally start the agent -----------------------
boolean success = this.startAgent(agent2Start.getStartAsName(), agent2Start.getAgentClassReference(), startArgs, location);
if(success && verbose){
System.out.println("Agent "+ agent2Start.getStartAsName() + " started on "+ location.getName());
}
}
} // --- end while
return true;
}
return false;
}
示例11: getPrefixes
import java.util.Vector; //导入方法依赖的package包/类
/**
* TODO: Namespace doesn't give information giving multiple prefixes for
* the same namespaceURI.
*/
public java.util.Iterator getPrefixes(String namespaceURI) {
if (namespaceURI == null) {
throw new IllegalArgumentException("URI can't be null.");
}
else {
Vector vector =
((NamespaceSupport) fNamespaceContext).getPrefixes(namespaceURI.intern());
return vector.iterator();
}
}
示例12: findString
import java.util.Vector; //导入方法依赖的package包/类
public boolean findString(Vector v, String s) {
for (Iterator iter = v.iterator(); iter.hasNext(); ) {
if (((String) iter.next()).equals(s)) {
return true;
}
}
return false;
}
示例13: createPatternString
import java.util.Vector; //导入方法依赖的package包/类
private String createPatternString(Vector<Calendar> startDates, Vector<Calendar> endDates){
Iterator<Calendar> startDateIt = startDates.iterator();
Iterator<Calendar> endDateIt = endDates.iterator();
StringBuffer patternString = new StringBuffer();
Calendar lastDate = null;
while(startDateIt.hasNext() && endDateIt.hasNext()){
Calendar startDate = Calendar.getInstance();
startDate.setTime(((Calendar) startDateIt.next()).getTime());
Calendar endDate = Calendar.getInstance();
endDate.setTime(((Calendar) endDateIt.next()).getTime());
if (lastDate != null){
lastDate.add(Calendar.DAY_OF_MONTH, 1);
while(getCalendarDateString(lastDate).compareTo(getCalendarDateString(startDate)) < 0){
patternString.append("0");
lastDate.add(Calendar.DAY_OF_MONTH, 1);
}
}
lastDate = endDate;
while(getCalendarDateString(startDate).compareTo(getCalendarDateString(endDate)) <= 0) {
patternString.append("1");
startDate.add(Calendar.DAY_OF_MONTH, 1);
}
}
return(patternString.toString());
}
示例14: upgradeTaskList
import java.util.Vector; //导入方法依赖的package包/类
public static boolean upgradeTaskList(String publicId) {
int vid = getIndexOfVersion(publicId);
if (vid == (VERSIONS.length - 1)) {
Util.debug("Version " + publicId + " is the latest version, skipping upgrade");
return false;
}
else {
// get all projects
Vector projects = ProjectManager.getAllProjects();
String[] projectIds = new String[projects.size()];
int c = 0;
for (Iterator iter = projects.iterator(); iter.hasNext();) {
Project prj = (Project) iter.next();
projectIds[c++] = prj.getID();
}
// keep upgrading until it's the current version
while (vid < (VERSIONS.length - 1)) {
if(vid == 0) {
upgrade1_1d1(projectIds);
}
vid++;
}
return true;
}
}
示例15: buildFields
import java.util.Vector; //导入方法依赖的package包/类
/**
*
*/
private void buildFields() {
Vector properties = component.getProperties().getAllProperties();
GridLayout layout = new GridLayout(properties.size(),2,10,10);
int cells = 0;
Iterator i = properties.iterator();
JPanel fieldsPane = new JPanel(layout);
fieldsPane.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
while (i.hasNext()) {
try {
InteractiveProperty property = (InteractiveProperty) i.next();
final JTextField field = new JTextField(property.toString());
field.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
applyChanges();
}
else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
cancelChanges();
}
}
});
field.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent evt) {
String text = field.getText();
field.setSelectionStart(0);
field.setSelectionEnd(text.length());
}
});
field.setMaximumSize(new Dimension(150,30));
fields.put(property,field);
fieldsPane.add(new JLabel(property.getName()));
fieldsPane.add(field);
cells++;
} catch (ClassCastException exc) {
/*
* caught to be ignored, so that non-interactive properties
* won't be shown in the GUI
*/
}
}
this.setSize(200,cells * CELL_HEIGHT);
getContentPane().add(fieldsPane,BorderLayout.CENTER);
}