Java Code Examples for java.util.Vector#indexOf()

The following examples show how to use java.util.Vector#indexOf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractSector.java    From ramus with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Метод повертає масив під’єднаних до точки секторів, при чому всі сектори
 * знаходяться на одному функціональному блоці.
 *
 * @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);
}
 
Example 2
Source File: Window.java    From jcurses with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Get the next widget by direction
 * 0 - Left
 * 1 - Right
 * 2 - Up 
 * 3 - Down
 * @param direction
 * @return
 */
private Widget getNextWidget(int direction) { 
	Widget result = getCurrentWidget();
	int searchDirection = ((direction == 0) || (direction == 2))?-1:1;

	Vector<Widget> widgets = _focusableChilds;
	int index = widgets.indexOf(result);
	if (index < 0) {
		throw new RuntimeException("widget in the sorted queue not found!!");
	}
	index += searchDirection;
	while (index<widgets.size() && index>=0){
		if (widgets.get(index).isFocusable()) break;
		index += searchDirection;
	}
	if (index>=0 && index<widgets.size()){
		result = widgets.get(index);
	}
	return result;		
}
 
Example 3
Source File: BuildConfig.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
    }
}
 
Example 4
Source File: AbstractSector.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Метод повертає набір дочірніх до сектора секторів.
 *
 * @param point Точка дочірні сектори з якої беруться.
 * @return Масив дочірніх то сектора секторів, які пов’язані через точку.
 */

protected void getChilds(final Crosspoint point, final Vector<Sector> v) {
    if (point == null || point.isChild(this))
        return;
    final Sector[] s = point.getOppozite(this);
    for (final Sector element : s)
        if (v.indexOf(element) < 0)
            v.add(element);
}
 
Example 5
Source File: BuildConfig.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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);
    }
}
 
Example 6
Source File: BuildConfig.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
    }
}
 
Example 7
Source File: TbMatch.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
public static boolean termAnalysis(Vector<String> srcWord, Vector<String> termWords) {
	int termSize = termWords.size();
	if (termSize == 0) {
		return false;
	}

	if (termSize == 1) {
		if (srcWord.indexOf(termWords.get(0).toLowerCase()) != -1) {
			return true;
		} else {
			return false;
		}
	}

	int sIndex = srcWord.indexOf(termWords.get(0).toLowerCase(), 0);
	while (sIndex != -1 && sIndex + termSize - 1 < srcWord.size()) { // 有开始并且长度够
		// 从术语长度处取结尾单词比较是否相同
		if (srcWord.get(sIndex + termSize - 1).equalsIgnoreCase(termWords.get(termSize - 1))) {
			boolean isTerm = true;
			for (int i = 1, size = termSize - 1; i < size; i++) {
				if (!srcWord.get(sIndex + i).equalsIgnoreCase(termWords.get(i))) {
					isTerm = false;
					break;
				}
			}
			if (isTerm) {
				return true;
			}
		}
		sIndex = srcWord.indexOf(termWords.get(0).toLowerCase(), sIndex + 1);
	}
	return false;
}
 
Example 8
Source File: PersistenceUtil.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/** Given a diskStoreName and an array of disk directories:
 *     1) run the offline validator
 *     2) run the offline compactor
 *     3) run the offline validator again
 *  then check that the validator returns the same results before and
 *  after the compactor.
 *  
 * @param diskStoreName The name of a diskStore.
 * @param diskDirArr An array of Files, each element being a disk directory.
 */
public static void runOfflineValAndCompaction(String diskStoreName,
    File[] diskDirArr) {
  Vector<String> diskStoreNames = TestConfig.tab().vecAt(DiskStorePrms.names);
  int i = diskStoreNames.indexOf(diskStoreName);
  Vector<String> maxOpLogSizes = TestConfig.tab().vecAt(DiskStorePrms.maxOplogSize, new HydraVector());
  long opLogSize = 0;
  if ((maxOpLogSizes.size() == 0) || (i < 0) || (i >= maxOpLogSizes.size())) {
    opLogSize = DiskStoreFactory.DEFAULT_MAX_OPLOG_SIZE;
  } else {
    opLogSize = Long.valueOf(maxOpLogSizes.get(i));
  }

  try {
    // run and save validator results before compaction
    Object[] tmp = runOfflineValidate(diskStoreName, diskDirArr);
    String beforeCompactionStr = (String)tmp[0];
    Map<String, Map<String, Integer>> beforeCompactionMap = (Map<String, Map<String, Integer>>)tmp[1];
    Log.getLogWriter().info("Before compaction, results map is " + beforeCompactionMap);

    // run compaction
    runOfflineCompaction(diskStoreName, diskDirArr, opLogSize);

    // run and save validator results after compaction
    tmp = runOfflineValidate(diskStoreName, diskDirArr);
    String afterCompactionStr = (String)tmp[0];
    Map<String, Map<String, Integer>> afterCompactionMap = (Map<String, Map<String, Integer>>)tmp[1];
    Log.getLogWriter().info("After compaction, results map is " + afterCompactionMap);

    // check that before results is the same as after results; this compares the entryCount and
    // bucketCount for each region in the disk files
    if (!beforeCompactionMap.equals(afterCompactionMap)) {
      throw new TestException("Before compaction, validator results was " + beforeCompactionStr +
          " and after compaction, validator results is " + afterCompactionStr + 
      ", but expect validator results for entryCount/bucketCount to be equal");
    }
  } catch (Exception e) {
    throw new TestException(TestHelper.getStackTrace(e));
  }
}
 
Example 9
Source File: StandardAttributesPlugin.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean canDeleteElements(long[] elementIds, IEngine engine) {
    Vector<Long> vector = new Vector<Long>();
    for (long elementId : elementIds) {
        long qualifierId = engine.getQualifierIdForElement(elementId);
        Long l = new Long(qualifierId);
        if (vector.indexOf(l) < 0) {
            vector.add(l);
            if (qualifierId == qualifiers.getId()) {
                List<Persistent>[] lists = engine.getBinaryAttribute(
                        elementId, aQualifierId.getId());
                Long long1;
                if (lists[0].size() == 0)
                    long1 = null;
                else
                    long1 = ((LongPersistent) lists[0].get(0)).getValue();
                if (long1 == null)
                    continue;
                if (!rules.canDeleteQualifier(long1)) {
                    DeleteStatus status = new DeleteStatus();
                    status.setDelete(Delete.CAN_NOT);
                    return false;
                }
                continue;
            }
        }
    }
    return true;
}
 
Example 10
Source File: TbMatch.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
public static boolean termAnalysis(Vector<String> srcWord, Vector<String> termWords) {
	int termSize = termWords.size();
	if (termSize == 0) {
		return false;
	}

	if (termSize == 1) {
		if (srcWord.indexOf(termWords.get(0).toLowerCase()) != -1) {
			return true;
		} else {
			return false;
		}
	}

	int sIndex = srcWord.indexOf(termWords.get(0).toLowerCase(), 0);
	while (sIndex != -1 && sIndex + termSize - 1 < srcWord.size()) { // 有开始并且长度够
		// 从术语长度处取结尾单词比较是否相同
		if (srcWord.get(sIndex + termSize - 1).equalsIgnoreCase(termWords.get(termSize - 1))) {
			boolean isTerm = true;
			for (int i = 1, size = termSize - 1; i < size; i++) {
				if (!srcWord.get(sIndex + i).equalsIgnoreCase(termWords.get(i))) {
					isTerm = false;
					break;
				}
			}
			if (isTerm) {
				return true;
			}
		}
		sIndex = srcWord.indexOf(termWords.get(0).toLowerCase(), sIndex + 1);
	}
	return false;
}
 
Example 11
Source File: BuildConfig.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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);
    }
}
 
Example 12
Source File: List.java    From pluotsorbet with GNU General Public License v2.0 5 votes vote down vote up
private boolean testList(Enumeration e, String[] expected) {
	Vector found = new Vector(expected.length);
	
	while(e.hasMoreElements()) {
		String next = (String)e.nextElement();
		if (found.contains(next)) {
			assertTrueWithLog("list() returned duplicate strings: " + next, false);
			return false;
		}
		found.addElement(next);
	}
		
	for(int i=0; i<expected.length; i++) {
		int idx = found.indexOf(expected[i]);
		if (idx==-1) {
			assertTrueWithLog("list() did not return " + expected[i], false);
			return false;
		} else {
			found.removeElementAt(idx);
		}
	}
		
	if(found.size()>0) {
		String unexpected = (String)found.elementAt(0);
		assertTrueWithLog("list() returned unexpected strings " + unexpected, false);
		return false;
	}
	
	return true;
}
 
Example 13
Source File: JspUtil.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
/**
 * Checks if all mandatory attributes are present and if all attributes
 * present have valid names. Checks attributes specified as XML-style
 * attributes as well as attributes specified using the jsp:attribute
 * standard action.
 */
public static void checkAttributes(String typeOfTag, Node n,
        ValidAttribute[] validAttributes, ErrorDispatcher err)
        throws JasperException {
    Attributes attrs = n.getAttributes();
    Mark start = n.getStart();
    boolean valid = true;

    // AttributesImpl.removeAttribute is broken, so we do this...
    int tempLength = (attrs == null) ? 0 : attrs.getLength();
    Vector<String> temp = new Vector<String>(tempLength, 1);
    for (int i = 0; i < tempLength; i++) {
        @SuppressWarnings("null")  // If attrs==null, tempLength == 0
        String qName = attrs.getQName(i);
        if ((!qName.equals("xmlns")) && (!qName.startsWith("xmlns:"))) {
            temp.addElement(qName);
        }
    }

    // Add names of attributes specified using jsp:attribute
    Node.Nodes tagBody = n.getBody();
    if (tagBody != null) {
        int numSubElements = tagBody.size();
        for (int i = 0; i < numSubElements; i++) {
            Node node = tagBody.getNode(i);
            if (node instanceof Node.NamedAttribute) {
                String attrName = node.getAttributeValue("name");
                temp.addElement(attrName);
                // Check if this value appear in the attribute of the node
                if (n.getAttributeValue(attrName) != null) {
                    err.jspError(n,
                            "jsp.error.duplicate.name.jspattribute",
                            attrName);
                }
            } else {
                // Nothing can come before jsp:attribute, and only
                // jsp:body can come after it.
                break;
            }
        }
    }

    /*
     * First check to see if all the mandatory attributes are present. If so
     * only then proceed to see if the other attributes are valid for the
     * particular tag.
     */
    String missingAttribute = null;

    for (int i = 0; i < validAttributes.length; i++) {
        int attrPos;
        if (validAttributes[i].mandatory) {
            attrPos = temp.indexOf(validAttributes[i].name);
            if (attrPos != -1) {
                temp.remove(attrPos);
                valid = true;
            } else {
                valid = false;
                missingAttribute = validAttributes[i].name;
                break;
            }
        }
    }

    // If mandatory attribute is missing then the exception is thrown
    if (!valid) {
        err.jspError(start, "jsp.error.mandatory.attribute", typeOfTag,
                missingAttribute);
    }

    // Check to see if there are any more attributes for the specified tag.
    int attrLeftLength = temp.size();
    if (attrLeftLength == 0) {
        return;
    }

    // Now check to see if the rest of the attributes are valid too.
    String attribute = null;

    for (int j = 0; j < attrLeftLength; j++) {
        valid = false;
        attribute = temp.elementAt(j);
        for (int i = 0; i < validAttributes.length; i++) {
            if (attribute.equals(validAttributes[i].name)) {
                valid = true;
                break;
            }
        }
        if (!valid) {
            err.jspError(start, "jsp.error.invalid.attribute", typeOfTag,
                    attribute);
        }
    }
    // XXX *could* move EL-syntax validation here... (sb)
}
 
Example 14
Source File: HelpSearchManager.java    From MesquiteCore with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void countChainUserForward(MesquiteModuleInfo mmi, boolean mmiListingSuppressed, Vector moduleChain, Vector dutyChain, int depth, int maxDepth){
	if (moduleChain.indexOf(mmi)>=0) { //to prevent infinite recursion, e.g. for random tree modifiers
		return;
	}
	if (dutyChain.indexOf(mmi.getDutyClass())>=0) { //to prevent infinite recursion, e.g. for random tree modifiers
		return;
	}
	if (maxDepth > 0 && depth > maxDepth){
		return;
	}
	Vector v = MesquiteTrunk.mesquiteModulesInfoVector.whoUsesMe(mmi);
	if (v == null || v.size() == 0){
		return;
	}

	moduleChain.addElement(mmi);
	dutyChain.addElement(mmi.getDutyClass());
	for (int i = 0; i< v.size() && countUses<maxCount; i++){
		EmployeeNeed en = (EmployeeNeed)v.elementAt(i);
		if (en.getSuppressListing()){

			if (en.isEntryPoint()){
				countUses++;
				if (countUses % 1000 == 0)
					System.out.println("uses " + countUses);
			}
			else
				countChainUserForward(en.getRequestor(), true, moduleChain, dutyChain, depth, maxDepth);
		}
		else {
			if (en.isEntryPoint()){
				countUses++;
				if (countUses % 1000 == 0)
					System.out.println("uses " + countUses);
			}
			else
				countChainUserForward(en.getRequestor(), false, moduleChain, dutyChain, depth+1, maxDepth);

		}
	}
	dutyChain.removeElement(mmi.getDutyClass());
	moduleChain.removeElement(mmi);
}
 
Example 15
Source File: CommandTestVersionHelper.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
/** Determine if the given regionConfigName should be created considering the
 *  hydra param settings. 
 * @param regionConfigName The region config name to consider.
 * @return true if the region should be created, false otherwise.
 */
protected static boolean shouldCreateRegion(String regionConfigName) {
  String configNameLC = regionConfigName.toLowerCase();
  boolean createProxyRegions = CommandPrms.getCreateProxyRegions();
  boolean createClientRegions = CommandPrms.getCreateClientRegions();
  boolean createPersistentRegions = CommandPrms.getCreatePersistentRegions();
  boolean isProxyRegion = ((configNameLC.indexOf("empty") >= 0) ||
                           (configNameLC.indexOf("accessor") >= 0));
  boolean isClientRegion = configNameLC.startsWith("client");
  boolean isPersistentRegion = configNameLC.indexOf("persist") >= 0;

  // now find conditions to turn shouldCreateRegionsTo false
  if (isPersistentRegion && !createPersistentRegions) {
    return false;
  }
  if (isClientRegion != createClientRegions) {
    return false;
  }
  if (isProxyRegion != createProxyRegions) {
    return false;
  }

  // now check for limiting regions to some members but not all
  try {
    RegionAttributes attr = RegionHelper.getRegionAttributes(regionConfigName);
    if (attr.getPartitionAttributes() != null) {
      String colocatedWithRegion = attr.getPartitionAttributes().getColocatedWith();
      if (colocatedWithRegion != null) {
        // if the region this region is colocated with exists then we need to create it
        return !(CacheHelper.getCache().getRegion(colocatedWithRegion) == null);
      }
    }
  } catch (IllegalStateException e) {
    String errStr = e.toString();
    if (errStr.indexOf("Region specified in 'colocated-with' is not present") >= 0) { // colocated with region is not here so we can't create this region
      return false;
    } else {
      throw e;
    }
  }

  Vector configNamesVec = TestConfig.tab().vecAt(RegionPrms.names);
  int index = configNamesVec.indexOf(regionConfigName);
  String regionName = (String) TestConfig.tab().vecAt(RegionPrms.regionName).get(index);
  int numMembersToHostRegion = CommandPrms.getNumMembersToHostRegion();
  if (numMembersToHostRegion >= 0) { // we want to limit the number of members hosting a region
    SharedLock lock = CommandBB.getBB().getSharedLock();
    lock.lock();
    String key = regionName + "_counter";
    try {
      Integer counter = (Integer) CommandBB.getBB().getSharedMap().get(key);
      if (counter == null) {
        counter = 0;
      }
      counter = counter + 1;
      CommandBB.getBB().getSharedMap().put(key, counter);
      if (counter > numMembersToHostRegion) {
        Log.getLogWriter().info("Not creating " + regionName + " because this region is limited to existing in " + numMembersToHostRegion + " members");
        return false;
      }
    } finally {
      lock.unlock();
    }
  }

  return true;
}
 
Example 16
Source File: CompoundType.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected Vector updateParentClassMethods(ClassDefinition current,
                                          Vector currentMethods,
                                          boolean quiet,
                                          ContextStack stack)
    throws ClassNotFound {

    ClassDeclaration parentDecl = current.getSuperClass(env);

    while (parentDecl != null) {

        ClassDefinition parentDef = parentDecl.getClassDefinition(env);
        Identifier currentID = parentDecl.getName();

        if ( currentID == idJavaLangObject ) break;

        // Walk all members of this class and update any that
        // already exist in currentMethods...

        for (MemberDefinition member = parentDef.getFirstMember();
             member != null;
             member = member.getNextMember()) {

            if (member.isMethod() &&
                !member.isInitializer() &&
                !member.isConstructor() &&
                !member.isPrivate()) {

                // It's a method.  Is it valid?

                Method method;
                try {
                    method = new Method((CompoundType)this,member,quiet,stack);
                } catch (Exception e) {
                    // Don't report anything here, it's already been reported...
                    return null;
                }

                // Have we already seen it?

                int index = currentMethods.indexOf(method);
                if (index >= 0) {

                    // Yes, so update it...

                    Method currentMethod = (Method)currentMethods.elementAt(index);
                    currentMethod.setDeclaredBy(currentID);
                }
                else currentMethods.addElement(method);
            }
        }

        // Update parent and keep walking up the chain...

        parentDecl = parentDef.getSuperClass(env);
    }

    return currentMethods;
}
 
Example 17
Source File: CompoundType.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected Vector updateParentClassMethods(ClassDefinition current,
                                          Vector currentMethods,
                                          boolean quiet,
                                          ContextStack stack)
    throws ClassNotFound {

    ClassDeclaration parentDecl = current.getSuperClass(env);

    while (parentDecl != null) {

        ClassDefinition parentDef = parentDecl.getClassDefinition(env);
        Identifier currentID = parentDecl.getName();

        if ( currentID == idJavaLangObject ) break;

        // Walk all members of this class and update any that
        // already exist in currentMethods...

        for (MemberDefinition member = parentDef.getFirstMember();
             member != null;
             member = member.getNextMember()) {

            if (member.isMethod() &&
                !member.isInitializer() &&
                !member.isConstructor() &&
                !member.isPrivate()) {

                // It's a method.  Is it valid?

                Method method;
                try {
                    method = new Method((CompoundType)this,member,quiet,stack);
                } catch (Exception e) {
                    // Don't report anything here, it's already been reported...
                    return null;
                }

                // Have we already seen it?

                int index = currentMethods.indexOf(method);
                if (index >= 0) {

                    // Yes, so update it...

                    Method currentMethod = (Method)currentMethods.elementAt(index);
                    currentMethod.setDeclaredBy(currentID);
                }
                else currentMethods.addElement(method);
            }
        }

        // Update parent and keep walking up the chain...

        parentDecl = parentDef.getSuperClass(env);
    }

    return currentMethods;
}
 
Example 18
Source File: CompoundType.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected Vector updateParentClassMethods(ClassDefinition current,
                                          Vector currentMethods,
                                          boolean quiet,
                                          ContextStack stack)
    throws ClassNotFound {

    ClassDeclaration parentDecl = current.getSuperClass(env);

    while (parentDecl != null) {

        ClassDefinition parentDef = parentDecl.getClassDefinition(env);
        Identifier currentID = parentDecl.getName();

        if ( currentID == idJavaLangObject ) break;

        // Walk all members of this class and update any that
        // already exist in currentMethods...

        for (MemberDefinition member = parentDef.getFirstMember();
             member != null;
             member = member.getNextMember()) {

            if (member.isMethod() &&
                !member.isInitializer() &&
                !member.isConstructor() &&
                !member.isPrivate()) {

                // It's a method.  Is it valid?

                Method method;
                try {
                    method = new Method((CompoundType)this,member,quiet,stack);
                } catch (Exception e) {
                    // Don't report anything here, it's already been reported...
                    return null;
                }

                // Have we already seen it?

                int index = currentMethods.indexOf(method);
                if (index >= 0) {

                    // Yes, so update it...

                    Method currentMethod = (Method)currentMethods.elementAt(index);
                    currentMethod.setDeclaredBy(currentID);
                }
                else currentMethods.addElement(method);
            }
        }

        // Update parent and keep walking up the chain...

        parentDecl = parentDef.getSuperClass(env);
    }

    return currentMethods;
}
 
Example 19
Source File: myDataset.java    From KEEL with GNU General Public License v3.0 2 votes vote down vote up
/**
   * Returns a real representation of a attribute's nominal value given as argument.
   * @param atributo Attribute given.
   * @param valorNominal Nominal value of the attribute given.
   * @return Returns a real representation of a attribute's nominal value.
   */
  public static double valorReal(int atributo, String valorNominal){
  Vector nominales = Attributes.getInputAttribute(atributo).getNominalValuesList();
  int aux = nominales.indexOf(valorNominal);
  return 1.0*aux;
}
 
Example 20
Source File: myDataset.java    From KEEL with GNU General Public License v3.0 2 votes vote down vote up
/**
   * Returns a real representation of a attribute's nominal value given as argument.
   * @param atributo Attribute given.
   * @param valorNominal Nominal value of the attribute given.
   * @return Returns a real representation of a attribute's nominal value.
   */
  public static double valorReal(int atributo, String valorNominal){
  Vector nominales = Attributes.getInputAttribute(atributo).getNominalValuesList();
  int aux = nominales.indexOf(valorNominal);
  return 1.0*aux;
}