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


Java Vector.indexOf方法代碼示例

本文整理匯總了Java中java.util.Vector.indexOf方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector.indexOf方法的具體用法?Java Vector.indexOf怎麽用?Java Vector.indexOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.Vector的用法示例。


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

示例1: useAllAsArgument

import java.util.Vector; //導入方法依賴的package包/類
/**
 * Picks all attributes to be the arguments of the skolem and adds their names and positions to the RandSrcSkolem object.
 * 
 * @param r
 * 			The relation which we are adding the skolem to
 * @param scenario
 * 			The scenario which contains the relation
 * @param rsk
 * 			The RandSrcSkolem object which we wish to add the arguments to
 * @param allAttrs
 * 			All attributes in the source relation we are looking at
 * 
 * @throws Exception
 * 
 * @author mdangelo
 */
private static void useAllAsArgument(RelationType r, RandSrcSkolem rsk, String[] allAttrs) throws Exception 
{
	if (log.isDebugEnabled()) {log.debug("Using SkolemKind.ALL Mode for " + rsk.getSkId());};

	Vector<String> skAtts = new Vector<String>();
	
	for (String att : allAttrs)
		skAtts.add(att);
	
	// ensure that we are not adding the attribute itself as an argument to the skolem
	for (int i = 0; i < allAttrs.length; i++) 
		if (skAtts.indexOf(rsk.getAttr()) != -1)
			skAtts.remove(skAtts.indexOf(rsk.getAttr()));
	
	if (log.isDebugEnabled()) {log.debug("All Argument Set: " + skAtts.toString());};
	
	rsk.setArgAttrs(Utils.convertVectorToStringArray(skAtts));
	rsk.setArgPositions(getAttrPositions(allAttrs, rsk.getArgAttrs()));
}
 
開發者ID:RJMillerLab,項目名稱:ibench,代碼行數:36,代碼來源:RandomSourceSkolemToMappingGenerator.java

示例2: getConnectedOnFunction

import java.util.Vector; //導入方法依賴的package包/類
/**
 * Метод повертає масив під’єднаних до точки секторів, при чому всі сектори
 * знаходяться на одному функціональному блоці.
 *
 * @param crosspoint Точка перетену секторів.
 * @return Масив секторів, що під’єднані до точки.
 */

private void getConnectedOnFunction(final Crosspoint crosspoint,
                                    final Vector<Sector> v) {
    if (crosspoint == null)
        return;
    final Vector<Sector> ss = new Vector<Sector>();
    crosspoint.getSectors(ss);
    int i;
    final int n = ss.size();
    final int oLen = v.size();
    Sector s;
    for (i = 0; i < n; i++)
        if ((s = ss.get(i)).getFunction().equals(getFunction()))
            if (v.indexOf(s) < 0)
                v.add(s);
    final int len = v.size();
    for (i = oLen; i < len; i++)
        ((AbstractSector) v.get(i)).getConnectedOnFunction(v);
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:27,代碼來源:AbstractSector.java

示例3: canDeleteElements

import java.util.Vector; //導入方法依賴的package包/類
@Override
public boolean canDeleteElements(long[] elementIds) {
    Vector<Long> qualifierIds = new Vector<Long>();
    for (long elementId : elementIds) {
        Long qualifierId = engine.getQualifierIdForElement(elementId);
        if (qualifierIds.indexOf(qualifierId) < 0) {
            if (!canUpdateQualifier(qualifierId))
                return false;
            else
                qualifierIds.add(qualifierId);
        }
    }
    return true;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:15,代碼來源:AbstractIEngineAccessor.java

示例4: getStreamChilds

import java.util.Vector; //導入方法依賴的package包/類
private void getStreamChilds(final Vector<Sector> v) {
    final Stream stream = getStream();
    final Vector<Sector> n = new Vector<Sector>(3);
    getChilds(getStart().getCrosspoint(), n);
    getChilds(getEnd().getCrosspoint(), n);
    for (final Sector s : n) {
        if ((s.getStream() == null || stream != null
                && stream.equals(s.getStream()))
                && (v.indexOf(s) < 0)) {
            v.add(s);
            ((AbstractSector) s).getStreamChilds(v);
        }
    }
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:15,代碼來源:AbstractSector.java

示例5: getNextSibling

import java.util.Vector; //導入方法依賴的package包/類
public Node getNextSibling() {
    if ((mParentNode != null) && (this != mParentNode.getLastChild())) {
        Vector<Node> siblings = ((NodeImpl)mParentNode).mChildNodes;
        int indexOfThis = siblings.indexOf(this);
        return siblings.elementAt(indexOfThis + 1);
    }
    return null;
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:9,代碼來源:NodeImpl.java

示例6: getParents

import java.util.Vector; //導入方法依賴的package包/類
protected void getParents(final Crosspoint point, final Vector<Sector> v) {
    if (point == null)
        return;
    final Sector[] s = point.getOppozite(this);
    if (s.length != 1)
        return;
    for (final Sector element : s)
        if (v.indexOf(element) < 0)
            v.add(element);
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:11,代碼來源:AbstractSector.java

示例7: extAttr

import java.util.Vector; //導入方法依賴的package包/類
void extAttr(Vector receiver, String attr, String value) {
    int attr_pos=receiver.indexOf(attr) ;
    if ( attr_pos == -1) {
      // If attr IS NOT present in the Vector - add it
      receiver.add(attr); receiver.add(value);
    } else {
      // If attr IS present in the Vector - append value to it
      receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:11,代碼來源:BuildConfig.java

示例8: setBounds

import java.util.Vector; //導入方法依賴的package包/類
/**
 * Used when a spinne value is updated
 */
private void setBounds() {
	double xmin, xmax, ymin, ymax;
	Object val;
	String val1 = (String) Xmin.getValue();
	Vector v = (Vector) ((SpinnerListModel) Xmin.getModel()).getList();
	xmin = v.indexOf(val1) + 1;
	String val2 = (String) Xmax.getValue();
	Vector v2 = (Vector) ((SpinnerListModel) Xmax.getModel()).getList();
	xmax = v2.indexOf(val2) + 1;
	val = Ymin.getValue();
	if (val instanceof Number) {
		ymin = ((Number) val).doubleValue();
	} else {
		ymin = graph.getYRange()[0];
	}
	val = Ymax.getValue();
	if (val instanceof Number) {
		ymax = ((Number) val).doubleValue();
	} else {
		ymax = graph.getYRange()[1];
	}

	// Sets bounds
	graph.setXRange(xmin, xmax);
	graph.setYRange(ymin, ymax);
	graph.repaint();
}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:31,代碼來源:GraphArrivalPanel.java

示例9: removeAddedSectors

import java.util.Vector; //導入方法依賴的package包/類
private void removeAddedSectors(final Function f) {
    final Vector<PaintSector> v = new Vector<PaintSector>();
    for (int i = 0; i < refactor.getSectorsCount(); i++) {
        final PaintSector s = refactor.getSector(i);
        if (f.equals(s.getSector().getStart().getFunction()))
            if (v.indexOf(s) < 0)
                v.add(s);
        if (f.equals(s.getSector().getEnd().getFunction()))
            if (v.indexOf(s) < 0)
                v.add(s);
    }
    for (int i = 0; i < v.size(); i++)
        v.get(i).remove();
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:15,代碼來源:MovingArea.java

示例10: canDeleteElements

import java.util.Vector; //導入方法依賴的package包/類
@Override
public boolean canDeleteElements(long[] elementIds) {
    Vector<Long> vector = new Vector<Long>();
    for (long elementId : elementIds) {
        Long qualifierId = engine.getQualifierIdForElement(elementId);
        if (vector.indexOf(qualifierId) < 0) {
            if (!isHasAccess(qualifierId.longValue()))
                return false;
        }
        vector.add(qualifierId);
    }
    return true;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:14,代碼來源:ServerAccessRules.java

示例11: getSelRows

import java.util.Vector; //導入方法依賴的package包/類
private Row[] getSelRows(Qualifier clasificator) {
    final Enumeration e = params.keys();
    Vector v = new Vector();
    final String base = params.get("base");
    if (base == null) {
        while (e.hasMoreElements()) {
            final Object key = e.nextElement();
            final GlobalId id = GlobalId.convert(key.toString());
            if (id != null) {
                if (!params.get(key).equals("")) {
                    final Row r = dataPlugin.findRowByGlobalId(id);
                    if (r != null)
                        v.add(r);
                }
            }
        }
        final Vector rec = dataPlugin.getRecChildren(clasificator);
        final Vector res = new Vector();
        Object tmp;
        for (int i = 0; i < rec.size(); i++)
            if (v.indexOf(tmp = rec.get(i)) >= 0)
                res.add(tmp);
        v = res;
    } else {
        try {
            final Row row = dataPlugin.findRowByGlobalId(GlobalId
                    .convert(base));
            v = dataPlugin.getRecChilds(row, true);
            v.insertElementAt(row, 0);
        } catch (final Exception ex) {

        }
    }
    final Row[] rows = new Row[v.size()];
    for (int i = 0; i < rows.length; i++)
        rows[i] = (Row) v.get(i);
    return rows;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:39,代碼來源:HTTPParser.java

示例12: getLeft

import java.util.Vector; //導入方法依賴的package包/類
public Vector<Row> getLeft(final Row row) {
    final Vector<Row> res = a.getLeft(row);
    final Vector<Row> t = b.getLeft(row);
    for (int i = 0; i < t.size(); i++) {
        final Row r = t.get(i);
        if (res.indexOf(r) < 0)
            res.add(r);
    }
    return res;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:11,代碼來源:Adder.java

示例13: getRight

import java.util.Vector; //導入方法依賴的package包/類
public Vector<Row> getRight(final Row row) {
    final Vector<Row> res = a.getRight(row);
    final Vector<Row> t = b.getRight(row);
    for (int i = 0; i < t.size(); i++) {
        final Row r = t.get(i);
        if (res.indexOf(r) < 0)
            res.add(r);
    }
    return res;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:11,代碼來源:Adder.java

示例14: addRow

import java.util.Vector; //導入方法依賴的package包/類
private void addRow(final Vector<Row> res, Vector<GlobalId> ids,
                    final Row row) {
    if (ids.indexOf(GlobalId.create(engine
            .getQualifierIdForElement(((com.ramussoft.database.common.Row) row)
                    .getElementId()))) >= 0)
        res.add(row);
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:8,代碼來源:NFunction.java

示例15: getStreams

import java.util.Vector; //導入方法依賴的package包/類
/**
 * Повертає масив потоків пов’язаних з масивом секторів.
 *
 * @param sectors Масив секторів, з якого буде виділений масив потоків.
 * @return Масив потоків, виділений з масиву секторів.
 */

protected Stream[] getStreams(final Sector[] sectors) {
    final Vector<Stream> v = new Vector<Stream>();
    for (final Sector element : sectors)
        if (element.getStream() != null)
            if (v.indexOf(element.getStream()) < 0)
                v.add(element.getStream());
    final Stream[] streams = new Stream[v.size()];
    for (int i = 0; i < v.size(); i++)
        streams[i] = v.get(i);
    return streams;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:19,代碼來源:AbstractSector.java


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