Revision: 7881
http://sourceforge.net/p/bigdata/code/7881
Author: thompsonbry
Date: 2014-02-24 13:41:17 +0000 (Mon, 24 Feb 2014)
Log Message:
-----------
final attributes, etc.
Modified Paths:
--------------
branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/bnode/SidIV.java
Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/bnode/SidIV.java
===================================================================
--- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/bnode/SidIV.java 2014-02-24 12:51:24 UTC (rev 7880)
+++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/bnode/SidIV.java 2014-02-24 13:41:17 UTC (rev 7881)
@@ -42,6 +42,7 @@
import com.bigdata.rdf.internal.IV;
import com.bigdata.rdf.internal.IVUtility;
import com.bigdata.rdf.internal.VTE;
+import com.bigdata.rdf.internal.impl.AbstractIV;
import com.bigdata.rdf.internal.impl.AbstractInlineIV;
import com.bigdata.rdf.lexicon.LexiconRelation;
import com.bigdata.rdf.model.BigdataBNode;
@@ -100,6 +101,7 @@
*/
private transient V bnode;
+ @Override
public IV<V, ISPO> clone(final boolean clearCache) {
final SidIV<V> tmp = new SidIV<V>(spo);
@@ -135,9 +137,23 @@
}
- /**
+
+ /**
+ * Return the <code>flags</code> byte for a {@link SidIV}.
+ */
+ public static final byte toFlags() {
+ /*
+ * Note: XSDBoolean happens to be assigned the code value of 0, which is
+ * the value we want when the data type enumeration will be ignored.
+ */
+ return AbstractIV.toFlags(VTE.STATEMENT, true/* inline */,
+ false/* extension */, DTE.XSDBoolean);
+ }
+
+ /**
* Returns the inline spo.
*/
+ @Override
public ISPO getInlineValue() throws UnsupportedOperationException {
return spo;
}
@@ -146,12 +162,14 @@
* Returns the bnode representation of this IV, useful for serialization
* formats such as RDF/XML. See {@link #bnodeId()}.
*/
+ @SuppressWarnings("unchecked")
+ @Override
public V asValue(final LexiconRelation lex) {
- if (bnode == null) {
+ if (bnode == null) {
bnode = (V) lex.getValueFactory().createBNode(getID());
bnode.setIV(this);
bnode.setStatementIdentifier(true);
- }
+ }
return bnode;
}
@@ -159,10 +177,12 @@
* Return the byte length for the byte[] encoded representation of this
* internal value. Depends on the byte length of the encoded inline spo.
*/
+ @Override
public int byteLength() {
return 1 + key().length;
}
+ @Override
public String toString() {
return "Sid("+toString(spo)+")";
}
@@ -177,6 +197,7 @@
SPO.toString(spo.o()));
}
+ @Override
public int hashCode() {
return spo.hashCode();
}
@@ -204,6 +225,7 @@
/**
* Two {@link SidIV} are equal if their (s,p,o) IVs are equal.
*/
+ @Override
public boolean equals(final Object o) {
if (this == o)
return true;
@@ -219,7 +241,7 @@
return false;
}
- public int _compareTo(IV o) {
+ public int _compareTo(final IV o) {
/*
* Note: This works, but it might be more expensive.
@@ -299,7 +321,8 @@
this.key = iv.key();
}
- public void readExternal(ObjectInput in) throws IOException,
+ @Override
+ public void readExternal(final ObjectInput in) throws IOException,
ClassNotFoundException {
// flags = in.readByte();
final int nbytes = LongPacker.unpackInt(in);
@@ -307,7 +330,8 @@
in.readFully(key);
}
- public void writeExternal(ObjectOutput out) throws IOException {
+ @Override
+ public void writeExternal(final ObjectOutput out) throws IOException {
// out.writeByte(flags);
LongPacker.packLong(out, key.length);
out.write(key);
@@ -352,5 +376,4 @@
}
-
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|