當前位置: 首頁>>代碼示例>>Java>>正文


Java ImmutableList.copyOf方法代碼示例

本文整理匯總了Java中com.google.common.collect.ImmutableList.copyOf方法的典型用法代碼示例。如果您正苦於以下問題:Java ImmutableList.copyOf方法的具體用法?Java ImmutableList.copyOf怎麽用?Java ImmutableList.copyOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.common.collect.ImmutableList的用法示例。


在下文中一共展示了ImmutableList.copyOf方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: printFiltered

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
private static void printFiltered(final String contents, final DayOfWeek dayOfWeek) {
    final String nameOfDay = DAY_OF_WEEK_NAMES_MAP.get(dayOfWeek);
    final ImmutableList<String> lines = ImmutableList.copyOf(NEWLINE.split(contents));
    final int start = lines.indexOf(nameOfDay);
    if (start < 0) {
        logger.error("Not found for '{}' in pdf. (lines: {})", nameOfDay, lines);
        return;
    }
    logger.info("Menu for {}", dayOfWeek);
    lines.stream().skip(start).filter(line -> {
        final int idx = line.indexOf(' ');
        return (idx >= 0) && FOODS.contains(line.substring(0, idx));
    }).forEachOrdered(msg -> {
        logger.info("{}: {}", (Object[]) msg.split(" ", 2));
    });
}
 
開發者ID:tnovo,項目名稱:which-food-uptec-cli,代碼行數:17,代碼來源:App.java

示例2: HologramAnimation

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
/**
 * Creates a new animation with the specified parameters.
 *
 * @param loop      Whether or not to loop the animation at its conclusion.
 * @param frameDelay The delay, in ticks.
 * @param frames    The frames to be displayed.
 */
public HologramAnimation(boolean loop, long frameDelay, long startDelay, long endDelay, HologramFrame... frames) {
    Preconditions.checkArgument(frameDelay >= 1, "Tick delay must be at least 1 (was {0})", frameDelay);
    Preconditions.checkNotNull(frames, "Frames");
    Preconditions.checkArgument(frames.length > 1, "Frame count must be greater than 1 (was {0})", frames.length);
    this.frames = ImmutableList.copyOf(frames);

    int largest = 0;
    for (HologramFrame frame : this.frames) {
        largest = Math.max(largest, frame.getHeight());
    }
    this.maxHeight = largest;

    this.loop = loop;
    this.frameDelay = frameDelay;
    this.startDelay = startDelay;
    this.endDelay = endDelay;
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:25,代碼來源:HologramAnimation.java

示例3: getColumnNames

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
private ImmutableList<ColumnIdentifier> getColumnNames(
        final DatabaseConnectionGenerator connectionGenerator,
        final String tableName)
        throws AlgorithmExecutionException {
    String query = format("SELECT column_name FROM information_schema.columns WHERE table_name='%s'", getTableName(tableName));
    List<ColumnIdentifier> columnNames = new ArrayList<>();
    try (ResultSet resultSet = connectionGenerator.generateResultSetFromSql(query)) {
        while (resultSet.next()) {
            columnNames.add(new ColumnIdentifier(tableName, resultSet.getString("column_name")));
        }
    } catch (SQLException e) {
        throw new InputGenerationException(format("Error fetching column names of table %s", tableName), e);
    }
    return ImmutableList.copyOf(columnNames);
}
 
開發者ID:HPI-Information-Systems,項目名稱:AdvancedDataProfilingSeminar,代碼行數:16,代碼來源:PostgresDataAccessObject.java

示例4: MockTeConstraintBasedLinkWeight

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
/**
 * Creates a new edge-weight function capable of evaluating links
 * on the basis of the specified constraints.
 *
 * @param constraints path constraints
 */
MockTeConstraintBasedLinkWeight(List<Constraint> constraints) {
    if (constraints == null) {
        this.constraints = Collections.emptyList();
    } else {
        this.constraints = ImmutableList.copyOf(constraints);
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:14,代碼來源:PathComputationTest.java

示例5: SimpleCaseExpression

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
private SimpleCaseExpression(Optional<NodeLocation> location, Expression operand, List<WhenClause> whenClauses, Optional<Expression> defaultValue)
{
    super(location);
    requireNonNull(operand, "operand is null");
    requireNonNull(whenClauses, "whenClauses is null");

    this.operand = operand;
    this.whenClauses = ImmutableList.copyOf(whenClauses);
    this.defaultValue = defaultValue;
}
 
開發者ID:dbiir,項目名稱:rainbow,代碼行數:11,代碼來源:SimpleCaseExpression.java

示例6: getDecryptionProofs

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
public List<DecryptionProof> getDecryptionProofs() {
    return ImmutableList.copyOf(decryptionProofs);
}
 
開發者ID:republique-et-canton-de-geneve,項目名稱:chvote-protocol-poc,代碼行數:4,代碼來源:TallyData.java

示例7: of

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
/** Creates a chain. */
public static RelMetadataProvider of(List<RelMetadataProvider> list) {
  return new ChainedRelMetadataProvider(ImmutableList.copyOf(list));
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:5,代碼來源:ChainedRelMetadataProvider.java

示例8: getTupleEntityWriters

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
List<MessageBodyWriter<TupleEntity>> getTupleEntityWriters() {
  return ImmutableList.copyOf(tupleEntityWriters);
}
 
開發者ID:dotwebstack,項目名稱:dotwebstack-framework,代碼行數:4,代碼來源:SupportedMediaTypesScanner.java

示例9: TemplateComponent

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
public TemplateComponent(MessageTemplate message, List<BaseComponent> with) {
    this.message = message;
    this.with = ImmutableList.copyOf(with);
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:5,代碼來源:TemplateComponent.java

示例10: getS

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
public List<BigInteger> getS() {
    return ImmutableList.copyOf(s);
}
 
開發者ID:republique-et-canton-de-geneve,項目名稱:chvote-protocol-poc,代碼行數:4,代碼來源:NonInteractiveZKP.java

示例11: getQueuedTasks

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
public ImmutableList<Runnable> getQueuedTasks() {
    return ImmutableList.copyOf(tasks);
}
 
開發者ID:telstra,項目名稱:open-kilda,代碼行數:4,代碼來源:TestEventLoop.java

示例12: ProjectImportWizardController

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
public ProjectImportWizardController(IWizard projectImportWizard) {
    // assemble configuration object that serves as the data model of the wizard
    Validator<File> projectDirValidator = Validators.and(
            Validators.requiredDirectoryValidator("Project root directory"),
            Validators.nonWorkspaceFolderValidator("Project root directory"));
    Validator<GradleDistributionWrapper> gradleDistributionValidator = GradleDistributionValidator.gradleDistributionValidator();
    Validator<Boolean> applyWorkingSetsValidator = Validators.nullValidator();
    Validator<List<String>> workingSetsValidator = Validators.nullValidator();
    Validator<File> gradleUserHomeValidator = Validators.optionalDirectoryValidator("Gradle user home");

    this.configuration = new ProjectImportConfiguration(projectDirValidator, gradleDistributionValidator, gradleUserHomeValidator, applyWorkingSetsValidator, workingSetsValidator);

    // initialize values from the persisted dialog settings
    IDialogSettings dialogSettings = projectImportWizard.getDialogSettings();
    Optional<File> projectDir = FileUtils.getAbsoluteFile(dialogSettings.get(SETTINGS_KEY_PROJECT_DIR));
    Optional<String> gradleDistributionType = Optional.fromNullable(Strings.emptyToNull(dialogSettings.get(SETTINGS_KEY_GRADLE_DISTRIBUTION_TYPE)));
    Optional<String> gradleDistributionConfiguration = Optional.fromNullable(Strings.emptyToNull(dialogSettings.get(SETTINGS_KEY_GRADLE_DISTRIBUTION_CONFIGURATION)));
    Optional<File> gradleUserHome = FileUtils.getAbsoluteFile(dialogSettings.get(SETTINGS_KEY_GRADLE_USER_HOME));
    boolean applyWorkingSets = dialogSettings.get(SETTINGS_KEY_APPLY_WORKING_SETS) != null && dialogSettings.getBoolean(SETTINGS_KEY_APPLY_WORKING_SETS);
    List<String> workingSets = ImmutableList.copyOf(CollectionsUtils.nullToEmpty(dialogSettings.getArray(SETTINGS_KEY_WORKING_SETS)));
    boolean buildScansEnabled = dialogSettings.getBoolean(SETTINGS_KEY_BUILD_SCANS);
    boolean offlineMode = dialogSettings.getBoolean(SETTINGS_KEY_OFFLINE_MODE);

    this.configuration.setProjectDir(projectDir.orNull());
    this.configuration.setOverwriteWorkspaceSettings(false);
    this.configuration.setGradleDistribution(createGradleDistribution(gradleDistributionType, gradleDistributionConfiguration));
    this.configuration.setGradleUserHome(gradleUserHome.orNull());
    this.configuration.setApplyWorkingSets(applyWorkingSets);
    this.configuration.setWorkingSets(workingSets);
    this.configuration.setBuildScansEnabled(buildScansEnabled);
    this.configuration.setOfflineMode(offlineMode);

    // store the values every time they change
    saveFilePropertyWhenChanged(dialogSettings, SETTINGS_KEY_PROJECT_DIR, this.configuration.getProjectDir());
    saveGradleWrapperPropertyWhenChanged(dialogSettings, this.configuration.getGradleDistribution());
    saveFilePropertyWhenChanged(dialogSettings, SETTINGS_KEY_GRADLE_USER_HOME, this.configuration.getGradleUserHome());
    saveBooleanPropertyWhenChanged(dialogSettings, SETTINGS_KEY_APPLY_WORKING_SETS, this.configuration.getApplyWorkingSets());
    saveStringArrayPropertyWhenChanged(dialogSettings, SETTINGS_KEY_WORKING_SETS, this.configuration.getWorkingSets());
    saveBooleanPropertyWhenChanged(dialogSettings, SETTINGS_KEY_BUILD_SCANS, this.configuration.getBuildScansEnabled());
    saveBooleanPropertyWhenChanged(dialogSettings, SETTINGS_KEY_OFFLINE_MODE, this.configuration.getOfflineMode());
}
 
開發者ID:gluonhq,項目名稱:ide-plugins,代碼行數:42,代碼來源:ProjectImportWizardController.java

示例13: getT_4

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
public List<BigInteger> getT_4() {
    return ImmutableList.copyOf(t_4);
}
 
開發者ID:republique-et-canton-de-geneve,項目名稱:chvote-protocol-poc,代碼行數:4,代碼來源:ShuffleProof.java

示例14: getPlayers

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
@Override
public List<Player> getPlayers() {
    return ImmutableList.copyOf(views.keySet());
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:5,代碼來源:RenderedBossBar.java

示例15: MapTransaction

import com.google.common.collect.ImmutableList; //導入方法依賴的package包/類
public MapTransaction(TransactionId transactionId, List<MapUpdate<K, V>> updates) {
    this.transactionId = transactionId;
    this.updates = ImmutableList.copyOf(updates);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:5,代碼來源:MapTransaction.java


注:本文中的com.google.common.collect.ImmutableList.copyOf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。