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

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

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

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.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/io7m-smfj-format-text

 name = SMFAttributeName.of(line.get(1));
} catch (final IllegalArgumentException e) {
 super.failExpectedGot(
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();
}
origin: com.io7m.smfj/io7m-smfj-format-text

try {
 final SMFAttributeName name =
  SMFAttributeName.of(line.get(1));
 final SMFComponentType type =
  SMFComponentType.of(line.get(2));
origin: com.io7m.smfj/com.io7m.smfj.processing.main

final SMFAttributeName attr = SMFAttributeName.of(text.get(0));
origin: com.io7m.smfj/com.io7m.smfj.processing.main

/**
 * Attempt to parse a command.
 *
 * @param file The file, if any
 * @param line The line
 * @param text The text
 *
 * @return A parsed command or a list of parse errors
 */
public static Validation<List<SMFParseError>, SMFMemoryMeshFilterType> parse(
 final Optional<URI> file,
 final int line,
 final List<String> text)
{
 NullCheck.notNull(file, "file");
 NullCheck.notNull(text, "text");
 if (text.length() == 2) {
  try {
   final SMFAttributeName source = SMFAttributeName.of(text.get(0));
   final SMFAttributeName target = SMFAttributeName.of(text.get(1));
   return Validation.valid(
    create(source, target));
  } catch (final IllegalArgumentException e) {
   return errorExpectedGotValidation(file, line, makeSyntax(), text);
  }
 }
 return errorExpectedGotValidation(file, line, makeSyntax(), text);
}
origin: com.io7m.smfj.jcanephora/io7m-smfj-jcanephora-tests

 @Test
 public void testMappings()
 {
  final SMFArrayAttributeMapping m0 = SMFArrayAttributeMapping.of(
   SMFAttributeName.of("a"), 0, Optional.of(JCGLScalarType.TYPE_FLOAT), 4);
  final SMFArrayAttributeMapping m1 = SMFArrayAttributeMapping.of(
   SMFAttributeName.of("b"), 1, Optional.of(JCGLScalarType.TYPE_FLOAT), 4);

  final SMFArrayObjectConfiguration m =
   SMFArrayObjectConfiguration.builder()
    .setMappings(HashMap.ofEntries(List.of(
     Tuple.of(SMFAttributeName.of("a"), m0),
     Tuple.of(SMFAttributeName.of("b"), m1))))
    .setIndexBufferUsage(JCGLUsageHint.USAGE_DYNAMIC_COPY)
    .setArrayBufferUsage(JCGLUsageHint.USAGE_STREAM_READ)
    .build();

  Assert.assertEquals(JCGLUsageHint.USAGE_DYNAMIC_COPY, m.indexBufferUsage());
  Assert.assertEquals(JCGLUsageHint.USAGE_STREAM_READ, m.arrayBufferUsage());
  Assert.assertEquals(m0, m.mappings().get(SMFAttributeName.of("a")).get());
  Assert.assertEquals(m1, m.mappings().get(SMFAttributeName.of("b")).get());
  Assert.assertEquals(2L, (long) m.mappings().size());
 }
}
origin: com.io7m.smfj/com.io7m.smfj.processing.main

/**
 * Attempt to parse a command.
 *
 * @param file The file, if any
 * @param line The line
 * @param text The text
 *
 * @return A parsed command or a list of parse errors
 */
public static Validation<List<SMFParseError>, SMFMemoryMeshFilterType> parse(
 final Optional<URI> file,
 final int line,
 final List<String> text)
{
 NullCheck.notNull(file, "file");
 NullCheck.notNull(text, "text");
 if (text.length() == 1) {
  try {
   final SMFAttributeName attr = SMFAttributeName.of(text.get(0));
   return Validation.valid(create(attr));
  } catch (final IllegalArgumentException e) {
   return errorExpectedGotValidation(file, line, makeSyntax(), text);
  }
 }
 return errorExpectedGotValidation(file, line, makeSyntax(), text);
}
origin: com.io7m.smfj/com.io7m.smfj.processing.main

/**
 * Attempt to parse a command.
 *
 * @param file The file, if any
 * @param line The line
 * @param text The text
 *
 * @return A parsed command or a list of parse errors
 */
public static Validation<List<SMFParseError>, SMFMemoryMeshFilterType> parse(
 final Optional<URI> file,
 final int line,
 final List<String> text)
{
 NullCheck.notNull(file, "file");
 NullCheck.notNull(text, "text");
 if (text.length() == 2) {
  try {
   final SMFAttributeName name = SMFAttributeName.of(text.get(0));
   final int size = Integer.parseUnsignedInt(text.get(1));
   return valid(create(name, size));
  } catch (final IllegalArgumentException e) {
   return errorExpectedGotValidation(file, line, makeSyntax(), text);
  }
 }
 return errorExpectedGotValidation(file, line, makeSyntax(), text);
}
origin: com.io7m.smfj.jcanephora/io7m-smfj-jcanephora-tests

.setComponentType(type)
.setIndex(0)
.setName(SMFAttributeName.of("x"))
.build();
com.io7m.smfj.coreSMFAttributeNameof

Javadoc

Construct a new immutable SMFAttributeName instance.

Popular methods of SMFAttributeName

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • JButton (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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