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


Java Vector.get方法代码示例

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


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

示例1: checkForServiceTimesParametricSimulationAvaibleClasses

import java.util.Vector; //导入方法依赖的package包/类
/**
 * This method has a meaning only if used inside a service times parametric analysis.
 * It can be used to get the keys of classes avaible to perform that kind of parametric
 * analysis.
 * @param stationKey the key of the station whose service times will be varied.
 * @return a Vector containing the keys of avaible classes
 */
public Vector<Object> checkForServiceTimesParametricSimulationAvaibleClasses(Object stationKey) {
	Vector<Object> valid = new Vector<Object>(0, 1);
	Vector classes = cd.getClassKeys();
	for (int j = 0; j < classes.size(); j++) {
		Object thisClass = classes.get(j);
		Object temp = sd.getServiceTimeDistribution(stationKey, thisClass);
		if (temp instanceof Distribution) {
			Distribution distr = (Distribution) temp;
			if (distr.hasMean()) {
				valid.add(thisClass);
			}
		}
	}
	return valid;
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:23,代码来源:ParametricAnalysisChecker.java

示例2: addLayers

import java.util.Vector; //导入方法依赖的package包/类
void addLayers(Vector layers, LayerEntry parent) {
	String name = (String)ParseLink.getProperty( layers, "name");
	if( name==null ) name = "untitled_"+(++n_null);
	String description = (String)ParseLink.getProperty( layers, "description");
	if( description==null )description="";
	String url = (String)ParseLink.getProperty( layers, "url");
	Vector children = (url==null)
			? new Vector()
			: null;
	LayerEntry entry = new LayerEntry( parent, children, name, description, url);
	parent.getChildren().add( entry );
	Vector props = ParseLink.getProperties( layers, "layer");
	for( int k=0 ; k<props.size() ; k++) {
		Vector prop = (Vector)props.get(k);
		addLayers( prop, entry);
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:18,代码来源:LayerTree.java

示例3: addAll

import java.util.Vector; //导入方法依赖的package包/类
@Override
public synchronized boolean addAll(int index, Collection<? extends Vector<Number>> collection) {

	boolean fullSuccess = true;
	int newIndexPos = index;
	for (Vector<Number> rowVector : collection) {
		Number key = rowVector.get(this.getKeyColumnIndex());
		if (this.getKeyRowVectorTreeMap().get(key)==null) {
			this.getKeyRowVectorTreeMap().put(key, rowVector);
			super.add(newIndexPos, rowVector);
			newIndexPos++;
			
		}  else {
			System.err.println(this.typeDescription + ": Duplicate key value " + key + " - row data was not added!");
			fullSuccess = false;
		}
	}
	
	this.resetRowNumberAndReminderMaps();
	return fullSuccess;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:22,代码来源:TableModelDataVector.java

示例4: parseRow

import java.util.Vector; //导入方法依赖的package包/类
public static String[] parseRow( String line, String token ) {
	StringTokenizer st = new StringTokenizer(line,token, true);
	String s;
	Vector fields = new Vector();
	while( st.hasMoreTokens() ) {
		s = st.nextToken();
		if( s.equals(token) ) {
			fields.add("");
			continue;
		}
		s = s.trim();
		if( s.startsWith("\"")&&s.endsWith("\"") ) {
			if( s.length()<=2) s="";
			else s = s.substring(1, s.length()-1);
		} else if( s.startsWith("-99") || s.equals("-") ) {
			s = "";
		}
		fields.add(s);
		if( st.hasMoreTokens() )st.nextToken();
	}
	String[] vals = new String[fields.size()];
	for( int k=0 ; k<vals.length ; k++) vals[k]=(String)fields.get(k);
	return vals;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:25,代码来源:DSDPDataSet.java

示例5: orderByX

import java.util.Vector; //导入方法依赖的package包/类
/**
 * This function return a vector that contains the same point of the parameter one but
 * the points are ordered from the point with the biggest X to the point with the smallest X
 * @param v The vector to order
 * @return The vector ordered
 */
private Vector<Point2D> orderByX(Vector<Point2D> v) {
	Vector<Point2D> r = (Vector<Point2D>) v.clone();
	boolean again = true;

	while (again) {
		again = false;
		for (int k = 0; k < r.size() - 1; k++) {
			//Take the points
			Point2D p1 = r.get(k);
			Point2D p2 = r.get(k + 1);

			if (p1.getX() < p2.getX()) {
				//swap
				r.remove(k);
				r.insertElementAt(p2, k);
				r.remove(k + 1);
				r.insertElementAt(p1, k + 1);
				again = true;
			}
		}
	}
	return r;
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:30,代码来源:EngineConvex2D.java

示例6: setPanels

import java.util.Vector; //导入方法依赖的package包/类
/**
 * Медод ініцалізує масив з панелями для перетягування.
 */

public void setPanels() {
    movingFunctions.clear();
    final Vector fs = dataPlugin.getChilds(activeFunction, true);
    final Vector<MovingText> v = new Vector<MovingText>();
    for (int i = 0; i < fs.size(); i++)
        v.add(addIDEF0Object((Function) fs.get(i)));
    for (int i = 0; i < refactor.getTextCount(); i++)
        v.add(refactor.getText(i));
    for (int i = 0; i < refactor.getSectorsCount(); i++) {
        final PaintSector sector = refactor.getSector(i);
        if (sector.getText() != null)
            v.add(sector.getText());
    }
    panels = new MovingText[v.size()];
    for (int i = 0; i < panels.length; i++)
        panels[i] = v.get(i);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:22,代码来源:MovingArea.java

示例7: getMarkedNotes

import java.util.Vector; //导入方法依赖的package包/类
/**
    * @see net.sf.memoranda.NoteList#getMarkedNotes()
    */
   public Collection getMarkedNotes() {
       Vector v = new Vector();
       Elements yrs = _root.getChildElements("year");
       for (int yi = 0; yi < yrs.size(); yi++) {
           Year y = new Year(yrs.get(yi));
           Vector ms = y.getMonths();
           for (int mi = 0; mi < ms.size(); mi++) {
               Month m = (Month) ms.get(mi);
               Vector ds = m.getDays();
               for (int di = 0; di < ds.size(); di++) {
                   Day d = (Day) ds.get(di);
				Vector ns = d.getNotes();
				for(int ni = 0; ni < ns.size(); ni++) {
					NoteElement ne = (NoteElement) ns.get(ni);
					Note n = new NoteImpl(ne.getElement(), _project);
					if (n.isMarked()) v.add(n);
               }
           }
       }
   }
        return v;
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:26,代码来源:NoteListImpl.java

示例8: packSequence

import java.util.Vector; //导入方法依赖的package包/类
private static byte[] packSequence(String dna) {

		Vector<Byte> packed = new Vector<Byte>();
		byte p = 0;
		for (int i = 0; i < dna.length(); i++) {
			char c = dna.charAt(i);
			byte b = 0;
			b |= nucToIndex.get(c) << (i * 2) % 8;
			p |= b;
			if (i == dna.length() - 1 || (((i + 1) * 2) % 8 == 0 && i != 0)) {
				packed.add(p);
				p = 0;
			}
		}

		byte[] a = new byte[packed.size()];
		for (int i = 0; i < packed.size(); i++)
			a[i] = packed.get(i);

		return a;

	}
 
开发者ID:BenjaminAlbrecht84,项目名称:DAA_Converter,代码行数:23,代码来源:FastAQ_Reader_Parallel.java

示例9: getAllTags

import java.util.Vector; //导入方法依赖的package包/类
/**
 * returns combined tags of all notes
 * 
 * @return Set of tags
 */
public TreeSet<String> getAllTags() {
	_tagsSet.clear();
	Vector v = (Vector) getAllNotes();
	for (int i = 0; i < v.size(); i++) {
		Note n = (Note) v.get(i);
		_tagsSet.addAll(n.getTagSet());
	}
	return _tagsSet;
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:15,代码来源:NoteListImpl.java

示例10: getValueByKey

import java.util.Vector; //导入方法依赖的package包/类
/**
 * Gets the value with the specified key / x value from the series with the specified index
 * @param seriesIndex The index of the series to get the value from
 * @param key The key / x value of the desired value
 * @return The value for the given key / x value
 * @throws NoSuchSeriesException Will be thrown if there is no series with the specified index
 */
public Float getValueByKey(int seriesIndex, Number key) throws NoSuchSeriesException{
	if(seriesIndex < this.getColumnCount()-this.tableModelDataVector.getNoOfPrefixColumns()){
		Vector<Number> rowVector = this.tableModelDataVector.getKeyRowVectorTreeMap().get(key);
		return (Float) rowVector.get(seriesIndex + this.tableModelDataVector.getNoOfPrefixColumns());
	}else{
		throw new NoSuchSeriesException();
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:16,代码来源:TableModel.java

示例11: getTargetLineInfo

import java.util.Vector; //导入方法依赖的package包/类
/**
 * Obtains information about all target lines of a particular type that are supported
 * by the installed mixers.
 *
 * @param info a <code>Line.Info</code> object that specifies the kind of
 *             lines about which information is requested
 * @return an array of <code>Line.Info</code> objects describing target lines matching
 * the type requested.  If no matching target lines are supported, an array of length 0
 * is returned.
 * @see Mixer#getTargetLineInfo(Line.Info)
 */
public static Line.Info[] getTargetLineInfo(Line.Info info) {

    Vector vector = new Vector();
    Line.Info[] currentInfoArray;

    Mixer mixer;
    Line.Info fullInfo = null;
    Mixer.Info[] infoArray = getMixerInfo();

    for (int i = 0; i < infoArray.length; i++) {

        mixer = getMixer(infoArray[i]);

        currentInfoArray = mixer.getTargetLineInfo(info);
        for (int j = 0; j < currentInfoArray.length; j++) {
            vector.addElement(currentInfoArray[j]);
        }
    }

    Line.Info[] returnedArray = new Line.Info[vector.size()];

    for (int i = 0; i < returnedArray.length; i++) {
        returnedArray[i] = (Line.Info) vector.get(i);
    }

    return returnedArray;
}
 
开发者ID:souhaib100,项目名称:MARF-for-Android,代码行数:39,代码来源:AudioSystem.java

示例12: getRoot

import java.util.Vector; //导入方法依赖的package包/类
public static String getRoot(Vector v)
{
	for(int i=0; i<v.size(); i++)
	{
		Element elmt = (Element) v.get(i);
		Vector partV = elmt.getPart();
		String tag = null;

		if(partV.size() > 0)
		{
			return (String)partV.get(0);
		}
	}
	return null;
}
 
开发者ID:tacola-auceg,项目名称:spellchecker_ta,代码行数:16,代码来源:Analyser.java

示例13: getNotesForPeriod

import java.util.Vector; //导入方法依赖的package包/类
public Collection getNotesForPeriod(CalendarDate startDate, CalendarDate endDate) {
    Vector v = new Vector();
    Elements yrs = _root.getChildElements("year");
    for (int yi = 0; yi < yrs.size(); yi++) {
        Year y = new Year(yrs.get(yi));
        if ((y.getValue() >= startDate.getYear()) && (y.getValue() <= endDate.getYear())) {
            Vector months = y.getMonths();
            for (int mi = 0; mi < months.size(); mi++) {
                Month m = (Month) months.get(mi);
                if (!((y.getValue() == startDate.getYear()) && (m.getValue() < startDate.getMonth()))
                    || !((y.getValue() == endDate.getYear()) && (m.getValue() > endDate.getMonth()))) {
                    Vector days = m.getDays();
                    for (int di = 0; di < days.size(); di++) {
                        Day d = (Day) days.get(di);
                        if (!((m.getValue() == startDate.getMonth()) && (d.getValue() < startDate.getDay()))
			|| !((m.getValue() == endDate.getMonth()) && (d.getValue() > endDate.getDay()))) {
				Vector ns = d.getNotes();
				for(int ni = 0; ni < ns.size(); ni++) {
					NoteElement n = (NoteElement) ns.get(ni);
					v.add(new NoteImpl(n.getElement(), _project));
				}
			}
                    }
                }
            }
        }
    }
    return v;
}
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:30,代码来源:NoteListImpl.java

示例14: resolveLonLat

import java.util.Vector; //导入方法依赖的package包/类
protected void resolveLonLat() {
	String s;
	lonCol=-1;
	latCol=-1;
	for( int k=0 ; k<headings.size() ; k++) {
		String tag="";
		try {
			tag = (String)headings.get(k);
		} catch(Exception e) {
			continue;
		}
		if( latCol==-1 && tag.toLowerCase().startsWith("lat") )latCol=k;
		if( lonCol==-1 && tag.toLowerCase().startsWith("lon") )lonCol=k;
	}
//	System.out.println( "lat,lon\t"+ latCol +"\t"+ lonCol);
	for( int k=0 ; k<rows.size() ; k++) {
		Vector row = (Vector)rows.get(k);
		for( int i=0 ; i<row.size() ; i++) {
			if( i==latCol || i==lonCol ) {
				s = (String)row.get(i);
				if( s!=null ) {
					double lat = ParseLatLon.parse( s );
					row.setElementAt( new Double(lat), i);
				}
			}
		}
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:29,代码来源:TableDB.java

示例15: getStationKey

import java.util.Vector; //导入方法依赖的package包/类
public Object getStationKey(String name) {
	Object key = null;
	Vector stations = sd.getStationKeys();
	for (int i = 0; i < stations.size(); i++) {
		if (sd.getStationName(stations.get(i)).equals(name)) {
			key = stations.get(i);
		}
	}
	return key;
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:11,代码来源:ParameterOptionPanel.java


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