org.openanzo.model.impl
Class AnzoLiteralImpl

java.lang.Object
  extended by org.openrdf.model.impl.LiteralImpl
      extended by org.openanzo.model.impl.AnzoLiteralImpl
All Implemented Interfaces:
java.io.Serializable, org.openrdf.model.Literal, org.openrdf.model.Value

public class AnzoLiteralImpl
extends org.openrdf.model.impl.LiteralImpl

Anzo extension of Literal object.

  • HashCode is stored in order to save compute time on multiple calls.
  • Slight memory tweak used to make sure labels and lang strings are not bloated.
    Somewhere in one of the parsers, strings are created with very large buffers, and due to a java implementation choice, when a string is substringed, the substring is merely a pointer to the char array of the parent string, with offset and length parameters set. This means that if a string has a 40k char buffer, even if the substring of that buffer is only 4 chars, the char array is still 40k long.

    Author:
    Matthew Roy ( mroy@cambridgesemantics.com )
    See Also:
    Serialized Form

    Constructor Summary
    AnzoLiteralImpl(java.lang.String label)
              Create new AnzoLiteral
    AnzoLiteralImpl(java.lang.String label, java.lang.String language)
              Create new AnzoLiteral
    AnzoLiteralImpl(java.lang.String label, org.openrdf.model.URI dataType)
              Create new AnzoLiteral
     
    Method Summary
     int hashCode()
               
     
    Methods inherited from class org.openrdf.model.impl.LiteralImpl
    booleanValue, byteValue, calendarValue, decimalValue, doubleValue, equals, floatValue, getDatatype, getLabel, getLanguage, integerValue, intValue, longValue, shortValue, toString
     
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    AnzoLiteralImpl

    public AnzoLiteralImpl(java.lang.String label,
                           org.openrdf.model.URI dataType)
    Create new AnzoLiteral

    Parameters:
    label - value of literal
    dataType - of literal

    AnzoLiteralImpl

    public AnzoLiteralImpl(java.lang.String label)
    Create new AnzoLiteral

    Parameters:
    label - value of literal

    AnzoLiteralImpl

    public AnzoLiteralImpl(java.lang.String label,
                           java.lang.String language)
    Create new AnzoLiteral

    Parameters:
    label - value of literal
    language - of literal
    Method Detail

    hashCode

    public int hashCode()
    Specified by:
    hashCode in interface org.openrdf.model.Literal
    Overrides:
    hashCode in class org.openrdf.model.impl.LiteralImpl


    Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.