Package com.intel.hadoop.graphbuilder.types

Examples of com.intel.hadoop.graphbuilder.types.StringType


    }
  }

  public Iterator<Vertex<StringType, EmptyType>> getVertices() {
    vlist.clear();
    vlist.add(new Vertex<StringType, EmptyType>(new StringType(title),
        EmptyType.INSTANCE));
    for (String link : links)
      vlist.add(new Vertex<StringType, EmptyType>(new StringType(link),
          EmptyType.INSTANCE));
    return vlist.iterator();
  }
View Full Code Here


      return EmptyIterator.INSTANCE;

    elist.clear();
    Iterator<String> iter = links.iterator();
    while (iter.hasNext()) {
      elist.add(new Edge<StringType, EmptyType>(new StringType(title),
          new StringType(iter.next()), EmptyType.INSTANCE));
    }
    return elist.iterator();
  }
View Full Code Here

*/
public class StringParser implements FieldParser<StringType> {

  @Override
  public StringType getValue(String text) {
    return new StringType(text);
  }
View Full Code Here

  @Override
  public Iterator<Vertex<StringType, StringType>> getVertices() {
    ArrayList<Vertex<StringType, StringType>> vlist = new ArrayList<Vertex<StringType, StringType>>(
        counts.size() + 1);
    vlist.add(new Vertex<StringType, StringType>(new StringType(id),
        new StringType(title)));
    Iterator<String> iter = counts.keySet().iterator();
    while (iter.hasNext()) {
      vlist.add(new Vertex<StringType, StringType>(new StringType(iter.next()),
          new StringType()));
    }
    return vlist.iterator();
  }
View Full Code Here

    ArrayList<Edge<StringType, StringType>> elist = new ArrayList<Edge<StringType, StringType>>(
        counts.size());
    Iterator<Entry<String, Integer>> iter = counts.entrySet().iterator();
    while (iter.hasNext()) {
      Entry<String, Integer> e = iter.next();
      elist.add(new Edge<StringType, StringType>(new StringType(id),
          new StringType(e.getKey()), new StringType(e.getValue().toString())));
    }
    return elist.iterator();
  }
View Full Code Here

  public static class Value extends PairListType<StringType, IntType> {

    @Override
    public StringType createLValue() {
      return new StringType();
    }
View Full Code Here

              TypeFactory.getClassName("int"));
      PairListType val1 = (PairListType) stringintclass.newInstance();
      assertEquals(val1.createLValue().getClass(), StringType.class);
      assertEquals(val1.createRValue().getClass(), IntType.class);

      val1.init(new StringType("hello"), new IntType(1));
      val1.add(new StringType("world"), new IntType(2));
      int i = val1.size();
      assertEquals(val1.size(), 2);
      PairListType val0 = (PairListType) stringintclass.newInstance();
      assertEquals(val0.size(), 0);
      val0.add(new StringType("foo"), new IntType(3));
      assertEquals(val0.size(), 1);
      val0.append(val1);
      assertEquals(val0.size(), val1.size() + 1);

      Class intstringclass = EdgeTransformJobValueFactory
View Full Code Here

    mirrorList.add((short) 1);
    mirrorList.add((short) 2);
    mirrorList.add((short) 3);
    mirrorList.add((short) 4);
    VertexRecord<StringType, StringType> vrec = new VertexRecord<StringType, StringType>();
    vrec.setVid(new StringType("testid"));
    vrec.setInEdges(1);
    vrec.setOutEdges(3);
    BitSet bs = new BitSet(numProcs);

    for (int j = 0; j < mirrorList.size(); j++)
      bs.set(mirrorList.get(j));
    vrec.setMirrors(bs);
    vrec.setVdata(new StringType("http://www.intel.com"));

    List<Short> mirrors = vrec.mirrorList();
    assertEquals("mirrorList:", mirrorList, mirrors);

    // System.out.println(vrec.toString());
View Full Code Here

TOP

Related Classes of com.intel.hadoop.graphbuilder.types.StringType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.