001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.html;
014
015/**
016 * Identifies possible float values for {@link HtmlDocSerializer.Builder#asideFloat(AsideFloat)}.
017 *
018 * <h5 class='section'>See Also:</h5><ul>
019 *    <li class='link'><a class="doclink" href="../../../../index.html#jm.HtmlDetails">HTML Details</a>
020 * </ul>
021 */
022public enum AsideFloat {
023
024   /**
025    * Float right of main contents.
026    */
027   LEFT,
028
029   /**
030    * Float left of main contents.
031    */
032   RIGHT,
033
034   /**
035    * Float above main contents.
036    */
037   TOP,
038
039   /**
040    * Float below main contents.
041    */
042   BOTTOM,
043
044   /**
045    * Default value (defaults to {@link #LEFT}
046    */
047   DEFAULT;
048
049   /**
050    * Returns <jk>true</jk> if value matches this enum.
051    *
052    * @param value The value to check against.
053    * @return <jk>true</jk> if value matches this enum.
054    */
055   public boolean is(AsideFloat value) {
056      return this == value;
057   }
058
059   /**
060    * Returns <jk>true</jk> if any of the values match this enum.
061    *
062    * @param values The values to check against.
063    * @return <jk>true</jk> if value matches this enum.
064    */
065   public boolean isAny(AsideFloat...values) {
066      for (AsideFloat v : values)
067         if (is(v))
068            return true;
069      return false;
070   }
071}