public class DataNode
extends java.lang.Object
DataStore.
Data nodes are equal by id.
| Constructor and Description |
|---|
DataNode(java.lang.String id,
byte[] data)
Create a new data node and fill with byte buffer
|
DataNode(java.lang.String id,
java.io.InputStream stream)
Create a new data node and fill with the input stream
|
DataNode(java.lang.String id,
java.io.Serializable data)
Create a new data node and fill it with the serialized representation of
the data object provided.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
byte[] |
getData()
Get a copy of the data
|
java.lang.Object |
getDataAsObject() |
java.lang.Object |
getDataAsObject(Bundle bundle) |
java.lang.Object |
getDataAsObject(Bundle bundle,
java.lang.Object defaultValue) |
java.lang.Object |
getDataAsObject(java.lang.ClassLoader classLoader) |
protected java.lang.Object |
getDataAsObject(java.io.ObjectInputStream stream) |
java.lang.String |
getId() |
int |
hashCode() |
java.lang.String |
toString() |
public DataNode(java.lang.String id,
byte[] data)
The byte buffer is copied by the constructor
id - The node iddata - the datapublic DataNode(java.lang.String id,
java.io.InputStream stream)
throws java.io.IOException
The input stream is read into the data buffer of the node
The stream is not closed by the constructor.
id - the node idstream - the stream to read fromjava.io.IOException - if stream reading failspublic DataNode(java.lang.String id,
java.io.Serializable data)
id - the node iddata - the data to serializepublic java.lang.String getId()
public byte[] getData()
public java.lang.Object getDataAsObject()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionprotected java.lang.Object getDataAsObject(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic java.lang.Object getDataAsObject(java.lang.ClassLoader classLoader)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic java.lang.Object getDataAsObject(Bundle bundle)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic java.lang.Object getDataAsObject(Bundle bundle,
java.lang.Object defaultValue)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
Copyright (c) IBH SYSTEMS GmbH and others 2010, 2013.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0