congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PrimitiveValue.longValue
Code IndexAdd Tabnine to your IDE (free)

How to use
longValue
method
in
uk.co.real_logic.sbe.PrimitiveValue

Best Java code snippets using uk.co.real_logic.sbe.PrimitiveValue.longValue (Showing top 20 results out of 315)

origin: real-logic/simple-binary-encoding

private boolean isRepresentableByInt32(final Encoding encoding)
{
  // These min and max values are the same in .NET
  return encoding.applicableMinValue().longValue() >= Integer.MIN_VALUE &&
    encoding.applicableMaxValue().longValue() <= Integer.MAX_VALUE;
}
origin: real-logic/simple-binary-encoding

private static void validateGroupMaxValue(
  final Node node, final PrimitiveType primitiveType, final PrimitiveValue value)
{
  if (null != value)
  {
    final long longValue = value.longValue();
    final long allowedValue = primitiveType.maxValue().longValue();
    if (longValue > allowedValue)
    {
      XmlSchemaParser.handleError(node, String.format(
        "maxValue greater than allowed for type: maxValue=%d allowed=%d", longValue, allowedValue));
    }
    final long maxInt = INT32.maxValue().longValue();
    if (primitiveType == UINT32 && longValue > maxInt)
    {
      XmlSchemaParser.handleError(node, String.format(
        "maxValue greater than allowed for type: maxValue=%d allowed=%d", longValue, maxInt));
    }
  }
  else if (primitiveType == UINT32)
  {
    final long maxInt = INT32.maxValue().longValue();
    XmlSchemaParser.handleError(node, String.format(
      "maxValue must be set for varData UINT32 type: max value allowed=%d", maxInt));
  }
}
origin: real-logic/simple-binary-encoding

public void onBitSet(
  final Token fieldToken,
  final DirectBuffer buffer,
  final int bufferIndex,
  final List<Token> tokens,
  final int beginIndex,
  final int endIndex,
  final int actingVersion)
{
  final Token typeToken = tokens.get(beginIndex + 1);
  final long encodedValue = readEncodingAsLong(buffer, bufferIndex, typeToken, actingVersion);
  printScope();
  out.append(determineName(0, fieldToken, tokens, beginIndex)).append(':');
  for (int i = beginIndex + 1; i < endIndex; i++)
  {
    out.append(' ').append(tokens.get(i).name()).append('=');
    final long bitPosition = tokens.get(i).encoding().constValue().longValue();
    final boolean flag = (encodedValue & (1L << bitPosition)) != 0;
    out.append(Boolean.toString(flag));
  }
  out.println();
}
origin: real-logic/simple-binary-encoding

/**
 * Construct a Choice given the XML node and the encodingType
 *
 * @param node         that contains the validValue
 * @param encodingType for the enum
 */
public Choice(final Node node, final PrimitiveType encodingType)
{
  name = getAttributeValue(node, "name");
  description = getAttributeValueOrNull(node, "description");
  value = PrimitiveValue.parse(node.getFirstChild().getNodeValue(), encodingType);
  sinceVersion = Integer.parseInt(getAttributeValue(node, "sinceVersion", "0"));
  deprecated = Integer.parseInt(getAttributeValue(node, "deprecated", "0"));
  // choice values are bit positions (0, 1, 2, 3, 4, etc.) from LSB to MSB
  if (value.longValue() >= (encodingType.size() * 8))
  {
    throw new IllegalArgumentException("Choice value out of bounds: " + value.longValue());
  }
  checkForValidName(node, name);
}
origin: real-logic/simple-binary-encoding

private static long readEncodingAsLong(
  final DirectBuffer buffer, final int bufferIndex, final Token typeToken, final int actingVersion)
{
  final PrimitiveValue constOrNotPresentValue = constOrNotPresentValue(typeToken, actingVersion);
  if (null != constOrNotPresentValue)
  {
    return constOrNotPresentValue.longValue();
  }
  return Types.getLong(buffer, bufferIndex, typeToken.encoding());
}
origin: real-logic/simple-binary-encoding

  private static long readEncodingAsLong(
    final DirectBuffer buffer, final int bufferIndex, final Token typeToken, final int actingVersion)
  {
    final PrimitiveValue constOrNotPresentValue = constOrNotPresentValue(typeToken, actingVersion);
    if (null != constOrNotPresentValue)
    {
      return constOrNotPresentValue.longValue();
    }

    return Types.getLong(buffer, bufferIndex, typeToken.encoding());
  }
}
origin: real-logic/simple-binary-encoding

public void onBitSet(
  final Token fieldToken,
  final DirectBuffer buffer,
  final int bufferIndex,
  final List<Token> tokens,
  final int fromIndex,
  final int toIndex,
  final int actingVersion)
{
  final Token typeToken = tokens.get(fromIndex + 1);
  final long encodedValue = readEncodingAsLong(buffer, bufferIndex, typeToken, actingVersion);
  property(determineName(0, fieldToken, tokens, fromIndex));
  output.append("{ ");
  for (int i = fromIndex + 1; i < toIndex; i++)
  {
    output.append('"').append(tokens.get(i).name()).append("\": ");
    final long bitPosition = tokens.get(i).encoding().constValue().longValue();
    final boolean flag = (encodedValue & (1L << bitPosition)) != 0;
    output.append(flag);
    if (i < (toIndex - 1))
    {
      output.append(", ");
    }
  }
  output.append(" }");
  next();
}
origin: real-logic/simple-binary-encoding

  dimensionHeaderLength));
final long minCount = numInGroupToken.encoding().applicableMinValue().longValue();
final String minCheck = minCount > 0 ? "count < " + minCount + " || " : "";
  cppTypeForBlockLength, blockLength, cppTypeForNumInGroup, dimensionHeaderLength,
  minCheck,
  numInGroupToken.encoding().applicableMaxValue().longValue()));
origin: real-logic/simple-binary-encoding

if (encodedValue == tokens.get(i).encoding().constValue().longValue())
origin: real-logic/simple-binary-encoding

    buffer.putByte(0, (byte)value.longValue());
buffer.putByte(0, (byte)value.longValue());
return 1;
buffer.putShort(0, (short)value.longValue(), ByteOrder.LITTLE_ENDIAN);
return 2;
buffer.putInt(0, (int)value.longValue(), ByteOrder.LITTLE_ENDIAN);
return 4;
buffer.putLong(0, value.longValue(), ByteOrder.LITTLE_ENDIAN);
return 8;
buffer.putByte(0, (byte)value.longValue());
return 1;
buffer.putShort(0, (short)value.longValue(), ByteOrder.LITTLE_ENDIAN);
return 2;
buffer.putInt(0, (int)value.longValue(), ByteOrder.LITTLE_ENDIAN);
return 4;
buffer.putLong(0, value.longValue(), ByteOrder.LITTLE_ENDIAN);
return 8;
origin: real-logic/simple-binary-encoding

final byte[] bytes = { (byte)constOrNotPresentValue.longValue() };
return new String(bytes, constOrNotPresentValue.characterEncoding());
origin: real-logic/simple-binary-encoding

indent + INDENT + "}\n",
parentMessageClassName,
numInGroupToken.encoding().applicableMinValue().longValue(),
numInGroupToken.encoding().applicableMaxValue().longValue(),
typeForBlockLength,
blockLength,
origin: real-logic/simple-binary-encoding

if (encodedValue == tokens.get(i).encoding().constValue().longValue())
origin: real-logic/simple-binary-encoding

parentMessageClassName,
mutableBuffer,
numInGroupToken.encoding().applicableMinValue().longValue(),
numInGroupToken.encoding().applicableMaxValue().longValue(),
blockLengthPut,
numInGroupPut));
origin: real-logic/simple-binary-encoding

final int sizeOfLengthField = lengthToken.encodedLength();
final Encoding lengthEncoding = lengthToken.encoding();
final int maxLengthValue = (int)lengthEncoding.applicableMaxValue().longValue();
final String byteOrderStr = byteOrderString(lengthEncoding);
origin: real-logic/simple-binary-encoding

else if (numInGroupMinValue.longValue() < 0)
    numInGroupMaxValue.longValue() : numInGroupType.primitiveType().maxValue().longValue();
  if (numInGroupMinValue.longValue() > max)
origin: real-logic/simple-binary-encoding

lengthCppType,
lengthByteOrderStr,
lengthToken.encoding().applicableMaxValue().longValue()));
origin: uk.co.real-logic/sbe-tool

private boolean isRepresentableByInt32(final Encoding encoding)
{
  // These min and max values are the same in .NET
  return encoding.applicableMinValue().longValue() >= Integer.MIN_VALUE &&
    encoding.applicableMaxValue().longValue() <= Integer.MAX_VALUE;
}
origin: uk.co.real-logic/sbe-tool

  private static long readEncodingAsLong(
    final DirectBuffer buffer, final int bufferIndex, final Token typeToken, final int actingVersion)
  {
    final PrimitiveValue constOrNotPresentValue = constOrNotPresentValue(typeToken, actingVersion);
    if (null != constOrNotPresentValue)
    {
      return constOrNotPresentValue.longValue();
    }

    return Types.getLong(buffer, bufferIndex, typeToken.encoding());
  }
}
origin: uk.co.real-logic/sbe-all

  private static long readEncodingAsLong(
    final DirectBuffer buffer, final int bufferIndex, final Token typeToken, final int actingVersion)
  {
    final PrimitiveValue constOrNotPresentValue = constOrNotPresentValue(typeToken, actingVersion);
    if (null != constOrNotPresentValue)
    {
      return constOrNotPresentValue.longValue();
    }

    return Types.getLong(buffer, bufferIndex, typeToken.encoding());
  }
}
uk.co.real_logic.sbePrimitiveValuelongValue

Javadoc

Return long value for this PrimitiveValue

Popular methods of PrimitiveValue

  • parse
    Parse constant value string and set representation based on type
  • size
    Return encodedLength for this PrimitiveValue for serialization purposes.
  • toString
    Return String representation of this object
  • <init>
    Construct and fill in value as a byte array.
  • byteArrayValue
    Return byte array value for this PrimitiveValue given a particular type
  • doubleValue
    Return double value for this PrimitiveValue.
  • representation
    Get the Representation of the value.
  • characterEncoding
    The character encoding of the byte array representation.

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now