当前位置: 首页>>代码示例>>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;未经允许,请勿转载。