Skip to content

Instantly share code, notes, and snippets.

@fge
fge / OneShotEvent.java
Last active March 1, 2016 11:44
A generic JavaFX "one shot" event implementation
public final class OneShotEvent<T extends Event>
implements EventHandler<T>
{
private final AtomicBoolean triggered = new AtomicBoolean(false);
private final EventHandler<T> delegate;
public static <E extends Event> EventHandler<E> of(final EventHandler<E> delegate)
{
return new OneShotEvent<>(delegate);
}
package com.github.fge.fs.ftp.directory;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPListParseEngine;
import java.nio.file.Path;
import java.util.Spliterator;
import java.util.function.Consumer;
public final class FtpDirectorySpliterator
package com.github.fge.multiterator.base;
import com.github.fge.multiterator.Values;
import java.util.Spliterator;
import java.util.function.Consumer;
import java.util.function.UnaryOperator;
public abstract class ValuesSpliteratorBase<T, V extends ValuesBase<T, V>>
implements Spliterator<Values<T>>
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
package es.litesolutions.sonar.objectscript.ast.grammars;
import es.litesolutions.sonar.objectscript.ast.tokens.flowctl.FlowCtl;
import es.litesolutions.sonar.objectscript.ast.tokens.identifiers.Identifiers;
import es.litesolutions.sonar.objectscript.ast.tokens.operators.Symbols;
import org.sonar.sslr.grammar.GrammarRuleKey;
import org.sonar.sslr.grammar.LexerfulGrammarBuilder;
public enum FlowctlGrammar
implements GrammarRuleKey
package com.github.fge;
import com.github.marschall.memoryfilesystem.MemoryFileSystemBuilder;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import java.io.IOException;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
private List<ParseTreeNode> getNodes(final Condition condition)
{
final Field<Integer> children = DSL.count().as("nrChildren");
final Table<Record2<Integer, Integer>> subnodes
= jooq.select(NODES.PARENT_ID, children)
.from(NODES)
.groupBy(NODES.PARENT_ID)
.asTable();
public final class RuleLookup<P extends SonarParserBase>
{
private static final MethodHandles.Lookup LOOKUP
= MethodHandles.publicLookup();
private static final MethodType RULE_METHOD
= MethodType.methodType(Rule.class);
private static final MethodType METHOD_TYPE
= MethodType.methodType(Rule.class, SonarParserBase.class);
private final Class<P> parserClass;
@fge
fge / meh
Created March 23, 2015 07:06
/**
* Create an AstScanner, whatever that is
*
* <p>All I know is that it's used by your implementation of your
* SquidSensor.</p>
*
* @param cfg the configuration (unused at the moment; which is good since
* it does nothing for now)
* @param visitors the list of squid AST visitors, whatever those are
* (checks?)
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Controller;
import com.gemtastic.carshop.tables.records.CustomerRecord;
import com.gemtastic.carshop.utils.JavafxUtils;
import javafx.collections.FXCollections;