Tabnine Logo
SMFAttributeName
Code IndexAdd Tabnine to your IDE (free)

How to use
SMFAttributeName
in
com.io7m.smfj.core

Best Java code snippets using com.io7m.smfj.core.SMFAttributeName (Showing top 20 results out of 315)

origin: com.io7m.smfj/com.io7m.smfj.validation.api

private static SMFSchemaValidationError errorExtraAttribute(
 final SMFAttributeName name)
{
 final StringBuilder sb = new StringBuilder(128);
 sb.append(
  "The mesh contains an extra attribute but the schema does not permit them.");
 sb.append(System.lineSeparator());
 sb.append("  Attribute: ");
 sb.append(name.value());
 sb.append(System.lineSeparator());
 return SMFSchemaValidationError.of(sb.toString(), Optional.empty());
}
origin: com.io7m.smfj.jcanephora/io7m-smfj-jcanephora-core

private boolean equalTo(SMFArrayAttributeMapping another) {
 return name.equals(another.name)
   && index == another.index
   && Objects.equals(componentType, another.componentType)
   && componentCount == another.componentCount;
}
origin: com.io7m.smfj.jcanephora/io7m-smfj-jcanephora-core

/**
 * Computes a hash code from attributes: {@code name}, {@code index}, {@code componentType}, {@code componentCount}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 int h = 5381;
 h += (h << 5) + name.hashCode();
 h += (h << 5) + index;
 h += (h << 5) + Objects.hashCode(componentType);
 h += (h << 5) + componentCount;
 return h;
}
origin: com.io7m.smfj/io7m-smfj-core

/**
 * Construct a new immutable {@code SMFAttributeName} instance.
 * @param value The value for the {@code value} attribute
 * @return An immutable SMFAttributeName instance
 */
public static SMFAttributeName of(String value) {
 return validate(new SMFAttributeName(value));
}
origin: com.io7m.smfj/com.io7m.smfj.validation.main

private Validation<List<SMFParseError>, SMFAttributeName>
parseName(
 final String text)
{
 try {
  return valid(SMFAttributeName.of(text));
 } catch (final IllegalArgumentException e) {
  return invalid(List.of(SMFParseError.of(
   this.reader.position(),
   "Could not parse attribute name: " + e.getMessage(),
   Optional.of(e))));
 }
}
origin: com.io7m.smfj/com.io7m.smfj.core

/**
 * Builds a new {@link SMFAttributeName SMFAttributeName}.
 * @return An immutable instance of SMFAttributeName
 * @throws java.lang.IllegalStateException if any required attributes are missing
 */
public SMFAttributeName build() {
 if (initBits != 0) {
  throw new IllegalStateException(formatRequiredAttributesMessage());
 }
 return SMFAttributeName.validate(new SMFAttributeName(null, value));
}
origin: com.io7m.smfj/io7m-smfj-core

private static SMFAttributeName validate(SMFAttributeName instance) {
 instance.checkPreconditions();
 return instance;
}
origin: com.io7m.smfj/com.io7m.smfj.core

/**
 * Creates an immutable copy of a {@link SMFAttributeNameType} value.
 * Uses accessors to get values to initialize the new immutable instance.
 * If an instance is already immutable, it is returned as is.
 * @param instance The instance to copy
 * @return A copied immutable SMFAttributeName instance
 */
public static SMFAttributeName copyOf(SMFAttributeNameType instance) {
 if (instance instanceof SMFAttributeName) {
  return (SMFAttributeName) instance;
 }
 return SMFAttributeName.builder()
   .from(instance)
   .build();
}
origin: com.io7m.smfj.jcanephora/io7m-smfj-jcanephora-tests

@Test
public void testDuplicate()
{
 final SMFArrayAttributeMapping m0 = SMFArrayAttributeMapping.of(
  SMFAttributeName.of("a"), 0, Optional.of(JCGLScalarType.TYPE_FLOAT), 4);
 final SMFArrayAttributeMapping m1 = SMFArrayAttributeMapping.of(
  SMFAttributeName.of("b"), 0, Optional.of(JCGLScalarType.TYPE_FLOAT), 4);
 this.expected.expect(IllegalArgumentException.class);
 SMFArrayObjectConfiguration.builder()
  .setMappings(HashMap.ofEntries(List.of(
   Tuple.of(SMFAttributeName.of("a"), m0),
   Tuple.of(SMFAttributeName.of("b"), m1))))
  .build();
}
origin: com.io7m.smfj/com.io7m.smfj.core

/**
 * Construct a new immutable {@code SMFAttributeName} instance.
 * @param value The value for the {@code value} attribute
 * @return An immutable SMFAttributeName instance
 */
public static SMFAttributeName of(String value) {
 return validate(new SMFAttributeName(value));
}
origin: com.io7m.smfj/io7m-smfj-core

/**
 * Builds a new {@link SMFAttributeName SMFAttributeName}.
 * @return An immutable instance of SMFAttributeName
 * @throws java.lang.IllegalStateException if any required attributes are missing
 */
public SMFAttributeName build() {
 if (initBits != 0) {
  throw new IllegalStateException(formatRequiredAttributesMessage());
 }
 return SMFAttributeName.validate(new SMFAttributeName(null, value));
}
origin: com.io7m.smfj/com.io7m.smfj.core

private static SMFAttributeName validate(SMFAttributeName instance) {
 instance.checkPreconditions();
 return instance;
}
origin: com.io7m.smfj/io7m-smfj-core

/**
 * Creates an immutable copy of a {@link SMFAttributeNameType} value.
 * Uses accessors to get values to initialize the new immutable instance.
 * If an instance is already immutable, it is returned as is.
 * @param instance The instance to copy
 * @return A copied immutable SMFAttributeName instance
 */
public static SMFAttributeName copyOf(SMFAttributeNameType instance) {
 if (instance instanceof SMFAttributeName) {
  return (SMFAttributeName) instance;
 }
 return SMFAttributeName.builder()
   .from(instance)
   .build();
}
origin: com.io7m.smfj/com.io7m.smfj.validation.api

private static SMFSchemaValidationError errorMissingAttribute(
 final SMFAttributeName name)
{
 final StringBuilder sb = new StringBuilder(128);
 sb.append("A required attribute is missing.");
 sb.append(System.lineSeparator());
 sb.append("  Attribute: ");
 sb.append(name.value());
 sb.append(System.lineSeparator());
 return SMFSchemaValidationError.of(sb.toString(), Optional.empty());
}
origin: com.io7m.smfj/io7m-smfj-format-text

 name = SMFAttributeName.of(line.get(1));
} catch (final IllegalArgumentException e) {
 super.failExpectedGot(
origin: com.io7m.smfj/com.io7m.smfj.validation.api

private boolean equalTo(SMFSchemaAttribute another) {
 return name.equals(another.name)
   && Objects.equals(requiredComponentType, another.requiredComponentType)
   && Objects.equals(requiredComponentCount, another.requiredComponentCount)
   && Objects.equals(requiredComponentSize, another.requiredComponentSize);
}
origin: com.io7m.smfj/com.io7m.smfj.processing.main

/**
 * Computes a hash code from attributes: {@code name}, {@code componentType}, {@code componentCount}, {@code componentSize}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 int h = 5381;
 h += (h << 5) + name.hashCode();
 h += (h << 5) + Objects.hashCode(componentType);
 h += (h << 5) + Objects.hashCode(componentCount);
 h += (h << 5) + Objects.hashCode(componentSize);
 return h;
}
origin: com.io7m.smfj/io7m-smfj-core

/**
 * Copy the current immutable object by setting a value for the {@link SMFAttributeNameType#value() value} attribute.
 * An equals check used to prevent copying of the same value by returning {@code this}.
 * @param value A new value for value
 * @return A modified copy of the {@code this} object
 */
public final SMFAttributeName withValue(String value) {
 if (this.value.equals(value)) return this;
 String newValue = Objects.requireNonNull(value, "value");
 return validate(new SMFAttributeName(this, newValue));
}
origin: com.io7m.smfj/com.io7m.smfj.validation.api

private static SMFSchemaValidationError errorWrongComponentSize(
 final SMFAttributeName name,
 final int expected,
 final int received)
{
 final StringBuilder sb = new StringBuilder(128);
 sb.append("Attribute component size is not the expected size.");
 sb.append(System.lineSeparator());
 sb.append("  Attribute: ");
 sb.append(name.value());
 sb.append(System.lineSeparator());
 sb.append("  Expected:  ");
 sb.append(expected);
 sb.append(System.lineSeparator());
 sb.append("  Received:  ");
 sb.append(received);
 sb.append(System.lineSeparator());
 return SMFSchemaValidationError.of(sb.toString(), Optional.empty());
}
origin: com.io7m.smfj.jcanephora/io7m-smfj-jcanephora-tests

@Test
public void testMisfiled()
{
 final SMFArrayAttributeMapping m0 = SMFArrayAttributeMapping.of(
  SMFAttributeName.of("a"), 0, Optional.of(JCGLScalarType.TYPE_FLOAT), 4);
 this.expected.expect(IllegalArgumentException.class);
 SMFArrayObjectConfiguration.builder()
  .setMappings(HashMap.of(SMFAttributeName.of("b"), m0))
  .build();
}
com.io7m.smfj.coreSMFAttributeName

Javadoc

An attribute name.

Most used methods

  • value
  • equals
    This instance is equal to all instances of SMFAttributeName that have equal attribute values.
  • hashCode
    Computes a hash code from attributes: value.
  • of
    Construct a new immutable SMFAttributeName instance.
  • <init>
  • builder
    Creates a builder for SMFAttributeName.
  • checkPreconditions
  • equalTo
  • validate

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • 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