关于java Enum
package rest;
/*created by fanqunsong
Date : 2018/2/23
Time : 10:56
*/
public class EnumTest {
enum Day{MONDAY, TUESDAY, WEDNESDAY,
THURSDAY, FRIDAY, SATURDAY, SUNDAY}
public static void main1(String[] args) {
Day day = Day.MONDAY;
System.out.println(day);
}
public static void main(String[] args) {
Day[] days = new Day[]{Day.MONDAY, Day.TUESDAY, Day.WEDNESDAY,
Day.THURSDAY, Day.FRIDAY, Day.SATURDAY, Day.SUNDAY};
for (int i = 0; i < days.length; i++) {
System.out.println("day["+i+"].ordinal():"+days[i].ordinal());
}
System.out.println("-------------------------------");
System.out.println("days[0].compareTo(days[1]):"+days[0].compareTo(days[1]));
System.out.println("days[0].compareTo(days[2]):"+days[0].compareTo(days[2]));
//获取该枚举对象的Class对象引用,当然也可以通过getClass方法
Class<?> clazz = days[0].getDeclaringClass();
System.out.println("clazz:"+clazz);
System.out.println("-------------------------------");
System.out.println("days[0].name():"+days[0].name());
System.out.println("-------------------------------");
System.out.println("days[0].toString():"+days[0].toString());
System.out.println("-------------------------------");
System.out.println("days[0]:"+days[0]);
}
}
输出为
day[0].ordinal():0
day[1].ordinal():1
day[2].ordinal():2
day[3].ordinal():3
day[4].ordinal():4
day[5].ordinal():5
day[6].ordinal():6
-------------------------------
days[0].compareTo(days[1]):-1
days[0].compareTo(days[2]):-2
clazz:class rest.EnumTest$Day
-------------------------------
days[0].name():MONDAY
-------------------------------
days[0].toString():MONDAY
-------------------------------
days[0]:MONDAY
---------------------------------------------------------------------
您输入的dip不存在,请重新输入
style="left: auto; padding-left: 20px; padding-right: 20px; margin-top: 20px;"
col-md-9
<!-- INCLUDE HEAD FILE -->
<!DOCTYPE html>
<!--
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.2
Version: 3.7.0
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Follow: www.twitter.com/keenthemes
Like: www.facebook.com/keenthemes
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<#include "common/header_css.ftl" />
<title>QLB DASHBOARD</title>
</head>
<body class="uniwebnav-ready page-header-fixed page-quick-sidebar-over-content page-container-bg-solid">
<div class="clearfix">
</div>
<div id="container" class="effect mainnav-sm navbar-fixed effect">
<div id="page-framework" class="boxed">
<input id="id" name="id" type="hidden" value="${id}">
<!-- BEGIN JIGSAW MAIN PAGE CONTAINER -->
<#--<div id="content-container" class="content-container">-->
<!-- BEGIN JIGSAW MARGIN ADJUST -->
<div class="content-pane ui-layout-center"
style="left: auto; padding-left: 20px; padding-right: 20px; margin-top: 20px;">
<div class="page-content-wrapper">
<div class="page-content">
<div class="row">
<!-- BEGIN??? -->
<div class="col-md-12">
<div class="col-md-12">
<div class="portlet box green col-md-3">
<div class="portlet-title">
<div class="portlet-title">
<a href=" " style="color:#fff">API????</a >
</div>
</div>
</div>
<div id="overview_duty" class="tab-pane active col-md-9">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="portlet ">
<div class="portlet-body" id="duty"></div>
<div></div>
</div>
</div>
</div>
</div>
</div>
<div id="overview_dashboard" class="tab-pane active">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="portlet ">
<div class="portlet-body" id="dashboard"></div>
<div></div>
</div>
</div>
</div>
</div>
<#if isAdmin??>
<div class="portlet box green">
<div class="portlet-title">
<div class="portlet-title">
<div id="pageTitle" class="caption">??&??</div>
</div>
</div>
<div class="portlet-body flip-scroll clearfix" >
<div class="row" style="padding-left: 10px">
<ul class="nav nav-tabs">
<li class=""><a data-toggle="tab"
href="#overview_flowtable">???? </a></li>
<li class=""><a data-toggle="tab"
href="#overview_flowline">???? </a></li>
<li class=""><a data-toggle="tab"
href="#overview_flowvip">VIP???? </a></li>
</ul>
<div class="tab-content">
<div id="overview_flowtable" class="tab-pane active">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="portlet ">
<div class="portlet-body" id="flowTable"></div>
<div></div>
</div>
</div>
</div>
</div>
<div id="overview_flowline" class="tab-pane">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="portlet ">
<div class="portlet-body" id="flowLine"></div>
<div></div>
</div>
</div>
</div>
</div>
<div id="overview_flowvip" class="tab-pane">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="portlet ">
<div class="portlet-body" id="flowVip"></div>
<div></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</#if>
</div>
<!-- END??? -->
</div>
<div class="clearfix"></div>
</div>
</div>
<!-- END CONTENT -->
<#--</div>-->
<!-- END JIGSAW MAIN PAGE CONTAINER -->
<!-- BEGIN JIGSAW MAIN NAV CONTAINER -->
<nav id="mainnav-container"></nav>
<#include "common/qlb_jigsaw_common_menu.ftl">
</div>
</div>
<!-- END JIGSAW TOTAL CONTAINER -->
<!-- INCLUDE FOOT HTML -->
<#include "common/footer_js.ftl">
<script src="/js/apps/qlb/dashboard/qlbdashboard.js?t=20180313"></script>
</body>
</html>