Java Code Examples for com.tinkerpop.blueprints.Element#getId()

The following examples show how to use com.tinkerpop.blueprints.Element#getId() . 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: MapReduceElement.java    From AccumuloGraph with Apache License 2.0 6 votes vote down vote up
public boolean equals(Object object) {
  if (object == this) {
    return true;
  } else if (object == null) {
    return false;
  } else if (!object.getClass().equals(getClass())) {
    return false;
  } else {
    Element element = (Element) object;
    if (id == null) {
      return element.getId() == null;
    } else {
      return id.equals(element.getId());
    }
  }
}
 
Example 2
Source File: DElementIterable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void add(final Element e) {
	Object rawid = e.getId();
	if (rawid instanceof String) {
		getIterator().add(NoteCoordinate.Utils.getNoteCoordinate((String) rawid));
	} else if (rawid instanceof NoteCoordinate) {
		getIterator().add((NoteCoordinate) rawid);
	} else {
		throw new IllegalStateException("Cannot process an element with an id of type " + rawid.getClass().getName());
	}
}
 
Example 3
Source File: DElementIterable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void set(final Element e) {
	Object rawid = e.getId();
	if (rawid instanceof String) {
		getIterator().set(NoteCoordinate.Utils.getNoteCoordinate((String) rawid));
	} else if (rawid instanceof NoteCoordinate) {
		getIterator().set((NoteCoordinate) rawid);
	} else {
		throw new IllegalStateException("Cannot process an element with an id of type " + rawid.getClass().getName());
	}

}
 
Example 4
Source File: DElementIterable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public boolean add(final Element e) {
	Object rawid = e.getId();
	if (rawid instanceof NoteCoordinate) {
		return index_.add((NoteCoordinate) rawid);
	}
	return false;
}
 
Example 5
Source File: DElementIterable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void add(final int index, final Element element) {
	Object rawid = element.getId();
	if (rawid instanceof NoteCoordinate) {
		index_.add(index, (NoteCoordinate) rawid);
	}
}
 
Example 6
Source File: DElementIterable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public boolean addAll(final Collection<? extends Element> c) {
	List<NoteCoordinate> nclist = new ArrayList<NoteCoordinate>();
	for (Element e : c) {
		Object rawid = e.getId();
		if (rawid instanceof NoteCoordinate) {
			nclist.add((NoteCoordinate) rawid);
		}
	}
	return index_.addAll(nclist);
}
 
Example 7
Source File: DElementIterable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public boolean addAll(final int index, final Collection<? extends Element> c) {
	List<NoteCoordinate> nclist = new ArrayList<NoteCoordinate>();
	for (Element e : c) {
		Object rawid = e.getId();
		if (rawid instanceof NoteCoordinate) {
			nclist.add((NoteCoordinate) rawid);
		}
	}
	return index_.addAll(index, nclist);
}
 
Example 8
Source File: DElementIterable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public boolean containsAll(final Collection<?> c) {
	List<NoteCoordinate> nclist = new ArrayList<NoteCoordinate>();
	for (Object raw : c) {
		if (raw instanceof Element) {
			Element e = (Element) raw;
			Object rawid = e.getId();
			if (rawid instanceof NoteCoordinate) {
				nclist.add((NoteCoordinate) rawid);
			}
		}
	}
	return index_.containsAll(nclist);
}
 
Example 9
Source File: DElementIterable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public boolean removeAll(final Collection<?> c) {
	List<NoteCoordinate> nclist = new ArrayList<NoteCoordinate>();
	for (Object raw : c) {
		if (raw instanceof Element) {
			Element e = (Element) raw;
			Object rawid = e.getId();
			if (rawid instanceof NoteCoordinate) {
				nclist.add((NoteCoordinate) rawid);
			}
		}
	}
	return index_.removeAll(nclist);
}
 
Example 10
Source File: DElementIterable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public boolean retainAll(final Collection<?> c) {
	List<NoteCoordinate> nclist = new ArrayList<NoteCoordinate>();
	for (Object raw : c) {
		if (raw instanceof Element) {
			Element e = (Element) raw;
			Object rawid = e.getId();
			if (rawid instanceof NoteCoordinate) {
				nclist.add((NoteCoordinate) rawid);
			}
		}
	}
	return index_.retainAll(nclist);
}
 
Example 11
Source File: DElementIterable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public Element set(final int index, final Element element) {
	Object rawid = element.getId();
	if (rawid instanceof NoteCoordinate) {
		index_.set(index, (NoteCoordinate) rawid);
	}
	return element;
}
 
Example 12
Source File: DElementStore.java    From org.openntf.domino with Apache License 2.0 4 votes vote down vote up
private void removeCache(final Element element) {
	Object key = element.getId();
	getElementCache().invalidate(key);
	getKeyMap().remove(key);
}